Sunday 13 January 2013

Core Java Interview Questions



21. Can we declare a main method as final?
Yes.

22. Can we declare an interface as final?
No.

23. Can we have an abstract class with no abstract methods in it?
Yes .

24. Can we have private and protected modifiers for variables in interfaces?
No. All variables in interface are public, Static, Final by default.

25. Is null a keyword?
No.

26. Can we override an overloaded method?
Yes.

27. What is runtime polymorphism?
It is the process in which the overridden method is decided at runtime.

28. What is abstraction in java?
It is hiding the implementation and showing only the functionality. Best example is the interface.

29. What is an abstract class?
A class declared as abstract is called asbtract class. It cannot be instantiated.

30. Can we declare a method abstract as well as final?
No. Abstract method need to be overridden but if you declare it final then we cannot override it.

                                                                 Previous - Next

No comments:

Post a Comment