Important concepts about methods Flashcards
1
Q
A
1.Return new Scanner(system.in).nextInt();
this will get an integer from the user without initializing a variable.
2
Q
what is a method?
A
- A method is a block of code that is joined together to perform a specific task.
2.Always use the return keyword in a method.
- You can call your method in the main method and print it or store it in a variable and print it.