Sunday 13 January 2013

Core Java Interview Questions



11. What is Inheritance?
One class acquiring the properties and behavior from another class is called inheritance.

12. Which is the super class of all classes?
Object class

13. Does java support pointers? Why?
No. Pointers refer to memory address. They are complex and not safe.

14. Can Main method be overloaded?
Yes. Main method can be overloaded.

15. What is method overloading in java?
Having methods of same name but with different parameters in a class is called method overloading.

16. What is method overriding in java?
Having methods of same name and same parameter but in different class is called as method overriding.

17. Can we override static methods?
It is not advisable to override static method but still it can be over rided. If they are over rided , the class will compile and run but the results might not be as expected because the static method is more bound to the class and not the class’s object.

18. What is a Final Class?
A class declared final cannot be inherited.

19. What is a Final Method?
A method declared final cannot be overridden.

20. What is a Final Variable?
A class declared final cannot be inherited.

                                                                    Previous - Next

No comments:

Post a Comment