Already Graded A
What is the main purpose of a method in Java?
A) To define variables
B) To store objects
✔✔C) To perform a specific task or calculation
D) To create new classes
Which keyword is used to define a method in Java?
✔✔A) **void**
B) **method**
C) **return**
D) **define**
What does a method’s return type specify?
A) The number of parameters it takes
✔✔B) The type of value the method returns
C) The name of the method
1
, D) The access level of the method
Which of the following is true about method parameters?
A) Methods cannot have parameters
✔✔B) Parameters allow values to be passed into a method
C) Parameters must be **static**
D) Parameters must be declared outside the method
How does Java handle method calls?
✔✔A) By passing arguments to the method and executing its code
B) By copying the method into the caller’s code
C) By converting the method into a loop
D) By automatically returning a value
What is the default return type of a method that does not return a value?
A) **int**
B) **null**
✔✔C) **void**
2