Campbell Ritchie wrote:Welcome to JavaRanch
Please use the CODE button; since you are new I have gone back to your post and edited it, so you can see how much better it looks. Please use copy-and-paste rather than a screenshot to show your output. Click the icon on the top left of the command prompt window, then edit, then mark, then use mouse to highlight, then enter key.
I couldn't read the full output, so I copied and executed your code; the output (as you have been told) looks correct to me.
I suggest you don't put your Java work on your desktop. Next time you open a command prompt, give it the following instructions:
mkdir java
cd java
You now have a "java" directory (you can call it anything you like) which will be inside "My Documents" and you can get there easily by typing
cd java
and you can keep all your work there