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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a method?

A
  1. 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.

  1. You can call your method in the main method and print it or store it in a variable and print it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly