Balajee Reva wrote:Hi All,
I passed 1z0-808 exam with 92% on 21st August.
1) Kathy Sierra BOOK
2)Enthuware exam
Campbell Ritchie wrote:Opinions will doubtless vary, but Java8 is still regarded as a current version, so it is probably an exaggeration to call 1Z0‑808 outdated.
Do you need a new cert to find a job? Has somebody told you to pass the Java11 exams?
Campbell Ritchie wrote:This question would fit better in a different forum, so I shall move it.
Search→“Utility class Scanner”→choose fora to search (ctrl‑click for several)→scroll down→user name
I hope that helps; if not, ask for more information.
[additonal} This discussion split from here. I didn't find much with those search terms; maybe Scanner hasNextInt nextInt will produce more hits.
Randy Tong wrote:What are all num referring to ?
Campbell Ritchie wrote:I would prefer to use a utility class for keyboard input. That class can hide the Scanner instance and also take care of that gotcha about nextLine(). You may not have the time to write a utility class, but if you search my posts for “Scanner utility class” you will eventually find enough parts to assemble a complete class (an one serious error).
Jj Roberts wrote:I'm glad you know more about Windows than me
. My exposure to Windows has been very limited. More than happy to stay on Ubuntu
![]()
Jj Roberts wrote:It does work if you are running it from the correct directory. What Knute is saying is that if your folders looked like my/folder/foo/bar/Zoo.java you would have to run
from the 'folder' directory. You have to run the commands from the directory which contains your package. In your case your file is at com/cha/iru/Zoo.java. What you need to do is navigate to the folder which com is in. Go and do that. Once you are in com's parent folder, you will need to run
(of course, if you are on Windows, the slashes go the other way).
Knute Snortum wrote:Say you are in the directory my/folder/ and your Java code has a package statement package foo.bar;, then the commands you want to issue from my/folder are
javac foo/bar/Zoo.java
java foo.bar.Zoo one two
The package statement translates into a folder path of foo/bar. javac take a path to a file. java takes a fully qualified class name.
Junilu Lacar wrote:Try changing directory to ..\first_project\src then do what Dave said to do.
If that doesn't work, cd to ..\first_project\out -- check to see if that's where your .class files are after you compile. If you're compiling from the command line, your class files might be under the ..\src directory though.
Dave Tolls wrote:Where are you executing the command from?
Where is the Zoo.class file?
What exact command are you executing?
Dave Tolls wrote:Which shows the esact issue, that Campbell mentioned.
Your Zoo class is in a package (com.cha.iru) which means its full class name is com.cha.iru.Zoo, and you would be expected to execute the compile file from the root directory for your package structure (ie the directory that contains the com folder). And the command would be:
java com.cha.iru.Zoo something something
Campbell Ritchie wrote:Welcome to the Ranch
![]()
I suggest you show us the code you are running please. “Wrong name” errors are often caused by having a package name in the code and putting the .class file in a folder with a name different from its package. As JJ says, you can run an uncompiled single XYZ.java file in Java11+; the fact that it isn't complaining suggests your .class files have a different name. Please copy'n'paste the text from your command line in future because it is much easier to handle like that. I can't see the screenshot from here, and had to open your post twice.
Jj Roberts wrote:Hello and welcome to the Ranch!
In Java 11 you can compile and run a single-file program by passing it directly to the java tool. That is what you are doing the second time.
It seems odd that it works that way, but says Zoo is the wrong name when you use javac and then java. What happens when you give it different arguments, like 'giraffe zebra'? What does your project's directory structure look like?
$ javac Zoo.java
$ java Zoo Bronx Zoo
The output is what you might expect:
Bronx
Zoo