Logo F2FInterview

Java Interview Questions

Q   |   QA

A method declared as final can't be overridden. A sub-class can't have the same method signature with a different implementation.

You should declared your class as final. But you can't define your class as final, if it is an abstract class. A class declared as final can't be extended by any other class.

Yes. You can have any number of main() methods with different method signature and implementation in the class.

Yes. Any inheriting class will not be able to have it's own default main() method.

No. It doesn't matter but void should always come before main().

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: