CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Java and JSP (http://www.codingforums.com/forumdisplay.php?f=54)
-   -   Help compiling a simple class (Solved) (http://www.codingforums.com/showthread.php?t=241638)

syronix 10-21-2011 05:23 PM

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.

Fou-Lu 10-21-2011 05:33 PM

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?

syronix 10-21-2011 05:34 PM

Quote:

Originally Posted by Fou-Lu (Post 1150024)
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.


All times are GMT +1. The time now is 04:59 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.