Error Cannot Find Symbol Scanner
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack bluej cannot find symbol class scanner Overflow the company Business Learn more about hiring developers or posting ads with us
Java Error Cannot Find Symbol Scanner
Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a
Error Cannot Find Symbol Javac
community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “cannot find symbol - class Scanner” error up vote 6 down vote favorite 2 This
Error Cannot Find Symbol Maven
is my Code public class Workshop3 { public static void main (String [] args) { System.out.println ("please enter radius of circle"); double radius; Scanner keyboard = new Scanner (System.in); keyboard.nextDouble (radius); } } The error I recieve is cannot find symbol - class scanner on the line Scanner keyboard = new Scanner (System.in); java share|improve this question edited Nov 13 '13 at 15:33 gunr2171 5,687103160 asked May 11 '11 at 3:56 error cannot find symbol variable James Blundell 26112 3 If you find any answer useful and does solve your problem then please accept the answer by clicking on the tick mark to the left of the answer.. This helps others who face the same problem and indicates them that this particular answer solved their problem.. –Mahendra May 11 '11 at 4:12 add a comment| 4 Answers 4 active oldest votes up vote 11 down vote As the OP is a new beginner to programming, I would like to explain more. You wil need this line on the top of your code in order to compile: import java.util.Scanner; This kind of import statement is very important. They tell the compile of which kind of Scanner you are about to use, because the Scanner here is undefined by anyone. After a import statement, you can use the class Scanner directly and the compiler will know about it. Also, you can do this without using the import statement, although I don't recommend: java.util.Scanner scanner = new java.util.Scanner(System.in); In this case, you just directly tell the compiler about which Scanner you mean to use. share|improve this answer answered May 11 '11 at 4:08 lamwaiman1988 1,45983773 add a comment| up vote 4 down vote You have to import java.util.Scan
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss error cannot find symbol class builder the workings and policies of this site About Us Learn more error cannot find symbol method findviewbyid(int) about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow error cannot find symbol class googleplayservicesclient Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each http://stackoverflow.com/questions/5959061/cannot-find-symbol-class-scanner-error other. Join them; it only takes a minute: Sign up Java error, Scanner cannot find symbol [closed] up vote 0 down vote favorite System.out.print("Are you sure you want to quit? (Y or N)"); char selection; selction = sc.nextChar(); if(selection == 'y' || 'Y'){ close = 1; }else if(selcetion == 'n' || 'N'){ break; }else{ System.out.println("Invalid Input"); } What http://stackoverflow.com/questions/10886043/java-error-scanner-cannot-find-symbol is wrong with this part of my program. The Scanner is initialized correctly in this method on top. Here is a screenshot of errors. http://i.stack.imgur.com/6nA3l.png java share|improve this question asked Jun 4 '12 at 18:11 Alex Vasilenko 33 closed as too localized by KatieK, joran, jadarnel27, Manuel, gnat Mar 6 '13 at 8:10 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. Your spelling mistakes don't seem to be a typo. Just use selection and not selction or selcetion or any other possible combination of it. –Kazekage Gaara Jun 4 '12 at 18:13 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote accepted Change
IP isWhoisCalculatorTool PointsNewsNews tip?ForumsAll ForumsHot TopicsGalleryInfoHardwareAll FAQsSite FAQDSL FAQCable TechAboutcontactabout uscommunityISP FAQAdd ISPISP Ind. ForumsJoin Search similar:[DSL] Wed 11 Jun, 11am ET, DSL issues[HELP] FXO disconnect issue.How do these get on to a computer?Upgrade Asterisk to an OAUTH2.0 connection with Google Voice[DSL] http://www.dslreports.com/forum/r11575395-Cant-find-scanner-class SmartRG configuration: unclear XML portionsASP page help Forums → The Site → Old Forums → Java → Cant find scanner class...? uniqs1544 Share « Java will not work on XP SP2 • is cjava.exe spyware? » PToNPremium Memberjoin:2001-10-04Houston, TX PToN Premium Member 2004-Oct-13 11:19 am Cant find scanner class...?Hello, i am taking this class on Java and when i cannot find try to compile any of my projects i get a message that the scanner class cant be found. I have tired Jgrasp, NetBeans, Kdevelop and others and it still wont work which makes me belive that there is something that i havent installed...The actual error says: " cant find symbol | symbol: class Scanner | location: package java.util"Any cannot find symbol ideas...?import java.util.Scanner;public class TempConverter{ public static void main (String[] args) { final int BASE = 32; final double COVERSION_FACTOR = 5.0 / 9.0; double fahrenheitTemp, celsiusTemp; System.out.print ("Please enter Fahrentheit Temperature: "); fahrenheitTemp = scan.nextDouble(); celsiusTemp = fahrenheitTemp - BASE * COVERSION_FACTOR; System.out.println ("Celsius Temperature: " + celsiusTemp); System.out.println ("Farenheit Equivalent: " + fahrenheitTemp); }}thanks · actions · 2004-Oct-13 11:19 am · (locked) GILXA1226MVMjoin:2000-12-29Dayton, OH GILXA1226 MVM 2004-Oct-13 1:10 pm try makeing the import line just like this:import java.util.*; · actions · 2004-Oct-13 1:10 pm · (locked) GILXA1226 GILXA1226 to PToN MVM 2004-Oct-13 1:53 pm to PToNupon further inspection of your code where are you declaring the variable scan from this line?fahrenheitTemp = scan.nextDouble(); · actions · 2004-Oct-13 1:53 pm · (locked) PToNPremium Memberjoin:2001-10-04Houston, TX PToN Premium Member 2004-Oct-14 3:17 pm I did what you told me and the import line doesnt give me an error, now all i get is that Scanner is not found... I also fixed the scan.nextDouble() part..any ideas...? · actions · 2004-Oct-14 3:17 pm · (locked) GILXA1226MVMjoin:2000-12-29Dayton, OH GILXA12