Multiple choice

Which of the following is true regarding overriding main method? i. main method can be overridden because it is having access modifier as public. ii. main method can be overridden because it is having return type as void. iii. main method can be overridden because the method is static. iv. main method cannot be overridden.

  1. Only i is correct

  2. Only ii is correct

  3. Only iii is correct

  4. Only iv is correct

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

This answer is correct because any static method cannot be overridden and so main method cannot be overridden.