can we declare the main method as final?
Yes, we declare the main method as final. public static final void main(String[] args){} Example public class Main { public static final void main(String[] args) { System.out.println("Final main method"); } }public class Main { public static final void main(String[] args) { System.out.println("Final main method"); } } Output Final main methodFinal main method Java interview questions … Read more