Is it possible to have multiple methods in one class?
And can I use the Scanner in methods other than the main method?
Many thanks
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Is it possible to have multiple methods in one class?
And can I use the Scanner in methods other than the main method?
Many thanks
Odd question. It's unusual to NOT have multiple methods in one class. Yes, a Scanner object may be used in methods other than the main() method. These are both odd questions and could be easily answered by writing a few lines of code.
thank you Greg. I'm just trying to figure out why one of my methods don't work when I run the programme.
Post the code you're having problems with and we can be more help.
Copy and paste the exact error messages as well.
Improving the world one idiot at a time!
I don't know what happened to it >.> The file just won't open. Oh well, if I come across the same problem I will come back to this thread. Thank you anyways guys.
My dog ate it.The file just won't open.