Question 19 M In Java, which of the following method declarations are valid: 1. final public void Hacker() { } 2. public void final Hacker() { } 3. public modifier void Hacker() { } 4. public static final void Hacker() { } 1 and 4 2 and 3 1 and 3
Answers
Answered by
3
Answer:
(b) Public void final Hacker
Explanation:
Only (b) is a valid method declaration. Methods must specify a return type or are declared void.
Answered by
1
Answer:
The method declaration which are valid are as follows:
- Public void final Hacker and
- Public modifier void Hacker.
Explanation:
Java is a famous programming used by more than 90% users worldwide. The keyword public static void is used to create a main method by a Java application. It is known to be the core method of the program. However, it neither can return values nor accepts parameters for complex command-line processing.
Similar questions