Grokking Java Interview Sample
Grokking Java Interview Sample
Grokking Java Interview Sample
[email protected]
Table Of Contents
PREFACE
Object Oriented Programming Interview
Questions
What is method overloading in OOP or Java?
What is the method overriding in OOP or Java?
What is the method of hiding in Java?
Is Java a pure object-oriented language? if not
why?
What are the rules of method overloading and
overriding in Java?
The difference between method overloading
and overriding?
Can we overload a static method in Java?
Can we override the static method in Java?
Can we prevent overriding a method without
using the final modifier?
Can we override a private method in Java?
What is the covariant method overriding in
Java?
Can we change the return type of method to
subclass while overriding?
This book aims to fill that gap and introduce you will
classical Java interview questions from these topics.
By going through these questions and topic you will
not only expand your knowledge but also get ready for
your Next Java interview. If you are preparing for Java
interviews then I highly recommend you go through
these questions before your telephonic or face-to-
face interviews, you will not only gain confidence and
knowledge to answer the question but also learn how
to drive Java interview in your favor. This is the single
most important tip I can give you as a Java developer.
Always, remember, your answers drive interviews, and
these questions will show you how to drive Interviewer
to your strong areas. All the best for Java interview and
if you have any questions or feedback you can always
contact me on twitter javinpaul or comment on my
blogs Javarevisited and Java67.
Yes, you can, but only from Java 5 onward. This feature
is known as covariant method overriding and it was
introduced in JDK 5 release. This is immensely helpful
if the original method return super-class like clone()
method return java.lang.Object. By using this, you can
directly return the actual type, preventing client-side
type-casting of the result.