Forums Register Login

Scanner class import issue

+Pie Number of slices to send: Send
I am working on a class assignment (not a java class... well it is a class on java, but not the meaning java has for class) and I am trying to get my program to allow user input from the command prompt. The problem is I keep getting errors about the import syntax saying that nothing is in the right place.




The program goes on, but I feel it is not important for the issue at hand. I appreciate any help on the matter
+Pie Number of slices to send: Send
Move line #5 (import statement) to line# 1 (before public class HultinBenProg4)
+Pie Number of slices to send: Send
Thanks a lot, no more errors, program compiles fine
+Pie Number of slices to send: Send
Are you taking classes in Java, or classes about Java classes, or Java classes about classes?

More seriously, although the Sun style guide is 10 years old, the order of parts of a class is still accurate. You may omit parts of the order; for example it mentions public fields, but as a design principle most classes only have private fields, so you simply ignore that part. Also in class exercises about classes in class ( ) you may not have time to write all your documentation comments.
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 887 times.
Similar Threads
Weird multiple output issue with if statements
Adding a new array element is not saving to memory
method construction trouble
Scanners, Strings and doubles... Help!
Identifier expected
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:01:59.