Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-21-2011, 05:23 PM   PM User | #1
syronix
New Coder

 
Join Date: Oct 2011
Location: Norfolk, VA
Posts: 19
Thanks: 11
Thanked 0 Times in 0 Posts
syronix is an unknown quantity at this point
Help compiling a simple class (Solved)

Hi I am currently learning java so I can develop android apps, but I just started so I need a little guidance as the books and tutorials I am using aren't perfect.
Code:
// I had forgotten to add 
//import.util.Scanner

class EchoLine {
	public static void main(String args[]) {
		
		Scanner eyeGlass = new Scanner(System.in); //This is Line 5
		System.out.println(eyeGlass.nextLine());
	}
}
For some reason I can't get this to compile, Jcreator is showing.

error: cannot find symbol line 5

#Solved

I forgot to use import java.util.Scanner, I can't believe i missed that it's like trying to use a gun with no bullets of course I'm gonna fail.

Last edited by syronix; 10-21-2011 at 08:45 PM.. Reason: Got ahead of myself (Solved)
syronix is offline   Reply With Quote
Old 10-21-2011, 05:33 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,752
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Assuming that everything works the same as standard Java, I'd expect all you need is to import java.util.Scanner. Does the error not indicate on what symbol its failing?
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
syronix (10-21-2011)
Old 10-21-2011, 05:34 PM   PM User | #3
syronix
New Coder

 
Join Date: Oct 2011
Location: Norfolk, VA
Posts: 19
Thanks: 11
Thanked 0 Times in 0 Posts
syronix is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
Assuming that everything works the same as standard Java, I'd expect all you need is to import java.util.Scanner. Does the error not indicate on what symbol its failing?
You're absolutely correct and sorry I didn't update sooner to let everyone know I had found my little mistake, thanks for responding so quickly though.
syronix is offline   Reply With Quote
Reply

Bookmarks

Tags
beginner, class, java

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:19 AM.


Advertisement
Log in to turn off these ads.