Share on Google+Share on Google+

Scanner class
1 Answer(s)      5 years and 5 months ago
Posted in : Java Beginners
import java.util.*;
class Dd
 public static void main(String args[])
   Scanner sc=new Scanner(;
   int a=sc.nextInt();
   int b=sc.nextInt();

What's wrong init. my program does not work it shows ""cannot resolve symbol"".


View Answers

November 12, 2011 at 12:05 PM

Here your code works fine..Which java version you are using? Actually Scanner class was introduced in java 5.

Related Tutorials/Questions & Answers:
Scanner class
Scanner class  import java.util.*; class Dd { public static void main(String args[]) { Scanner sc=new Scanner(; int... Scanner class was introduced in java 5
Scanner class
Scanner class  what have to do when an error occur about Scanner class.i code scanner sc=new Scanner(; but it shows an error regarding this.   Use Scanner sc=new Scanner(
scanner Class Error - Java Beginners
scanner Class Error  Hello Sir ,When i run the program of Scanner Class ,there is Error Can not Resolve Symbol-Scanner how i can solve..., Scanner class is not provided. Check your version.It should work with java 1.5
Scanner   Hi, I am facing a problem in the following code as what should be the while condition I should use in order to get the loop keep running...= "Celsius"; do { Scanner temp_ip= new Scanner(
Scanner  In java,while connectig keyboard through java.util.scanner does not throws IOException..why
can we use scanner class,class , object and methods to get output without using constructor ????
can we use scanner class,class , object and methods to get output without using constructor ????  im getting error here..i hav used scanner class... am i getting error here... can we get output using scanner class , object
Java file scanner
Scanner class. Description of code: J2SE5.0 provides some additional classes.... It also parses the primitive data. Scanner class gives a great deal of power..., we have used Scanner class to read the file. Output: Hello
without scanner
and class and didn't use the scanner .   Hi Friend, Whether
scanner program
scanner program  a news paper boy purchase 100 papers every day.he purchases papers at Rs.1.50 and sells at Rs.2.00 at each.any unsold news papers... his profit..using scanner
scanner problem - Java Beginners
scanner problem  the program that enters sides of the triangle using scanner and outputs the area of triangle  Hi Friend, We.... import java.util.*; public class AreaOfTriangle { public static void
scanner - Java Beginners
scanner   how to ask user to enter index in arry using scanner
cannot find symbol Scanner sc = new Scanner(
the Scanner class in your project. You should add: import java.util.Scanner...cannot find symbol Scanner sc = new Scanner(  In my one of the program in getting the error: cannot find symbol Scanner sc = new Scanner
Scanner vs. BufferedReader
Scanner vs. BufferedReader  I have to decide from these two classes... text files also which is around 7 to 10 GB. So, which class is to be used to read... should use the BufferedReader class. Check the details at What is the fastest
Hp scanner - Java Beginners
Hp scanner  Hi guys, i would like to access hp scanner using java programme. could you refer me some useful information to proceed
Line by Line reading from a file using Scanner Class
In this section, you will get to know about reading line by line a text file using java.util.Scanner class
not wish to use the scanner class Is there anything i can do to improve thiscode? import*; public class reursion { public void main()throws
Pattern,Matcher,Formatter and Scanner classes
the java.util.Formatter class. java.util.Scanner is a simple text scanner which can parse...(); Class java.util.Scanner implements a simple text scanner (lexical...Pattern,Matcher,Formatter and Scanner classes This section Describes : 1
barcode scanner device usage in database application
barcode scanner device usage in database application  Am trying to design a supermarket inventory desktop database application however I can't seem to know how to use a barcode scanner device on my application can anyone put me
with out using scanner mul two matrices
with out using scanner mul two matrices  write a java program to multiply two matrices and print there result. note: don't use the scanner and the values is passed at run time....   import*; class
How to read from the console
Description: Scanner was introduced in jdk 1.5. This class help in taking the input from the console. Here in this sample program it will take one word...;sc = new Scanner(cons.reader());     
input using scanner and add/sub/mul/div of a matrix
input using scanner and add/sub/mul/div of a matrix  hiiii...... performe matrix add/sub/mul/div using scanner
class  Is a class a subclass of itself
Creating a File I/O using import scanner, io.* and text.*
Creating a File I/O using import scanner, io.* and text.*  open a file for reading and open another file for writing data. input file hours-int, hourly rate-double, name-string. output file name-string, hours-int, hourly rate
is a class to represent a country in medal tally. It has an attribute of country... medals. In this class, you should also define constructors, and assessor, mutator methods. Task 2 is a class to model a medal tally, containing
Class, Object and Methods       Class : Whatever we can see in this world all the things... is termed as a class. All the objects are direct interacted with its class
Local Port Scanner
Local Port Scanner       This is a simple program of java network. Here, we are going to define class named "LocalPortScanner" in which we use ServerSocket class
file class
file class  Hi Friend, I have a file class it lets me extract all... java.util.*; public class ReadCSV{ public ReadCSV (){ } public static... File"); } Scanner in = new Scanner(; try
Super class of an Exception class
Super class of an Exception class  hello,,, What is super class of an Exception class?   hii,, the super class of an exception is throwable class. and the super class of an throwable class is the object class
How to Read file line by line in Java program
in Java using Scanner Class: Besides the Buffer reader, using Scanner class.... The benefit of using Scanner class is that it has more utilities like nextInt... line by line using Scanner Class: package ReadFile; import
Class       This section explores the concept of a class in reference to object oriented programming techniques. A class defines the properties of  objects and methods used
Java read text file
Class. The benefit of using Scanner class is that we do not need to convert... hasNextLine() method to read the contents of a file line by line. Scanner class.... readLine() method of BufferedReader class reads complete line and return
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code


Advertisement null