Computer Applications
The statement given below is termed as:
public void Accept(int a)
- Method signature
- Method block
- Method prototype
- Constructor
Answer
Method prototype
Reason — In Java, a method prototype specifies the method’s access specifier, return type, name, and parameter list without including its body. The statement public void Accept(int a) shows these elements but does not contain a method body, so it is a method prototype.
Related Questions
What will be the output of the following Java method?
Character.isLetterOrDigit('\n')- 1
- 0
- true
- false
Which of the following is not a type of token in Java?
1. Method 3. Literal 2. Identifier 4. Keyword - only 1
- 1 and 3
- only 2
- only 4
What is the output of the following Java code?
boolean flag = false; if (flag) { System.out.println("True"); } else { System.out.println("False"); }- True
- False
- No output
- Compilation error
Identify the static method from the list given below:
- length()
- nextLine()
- substring(int)
- isLetter(char)