Java Interview Questions
Java Interview Questions
If a class has more than one method with same name but with different list of
arguments, then it is called method overloading.
Java supports multiple inheritance but only through interfaces. That means a class
can implement more than one interfaces but can not extend more than one class.
Static method is common to all instances of a class. Static methods are stored in the
class memory. Where as non-static methods are stored in the object memory. Each
instance of a class will have their own copy of non-static methods.
this() represents the current instance of a super() represents the current instance
class of a parent/base class
Java is not 100% Object-oriented because it makes use of eight primitive data types
such as boolean, byte, char, int, float, double, long, short which are not objects.
In Java, access modifiers are special keywords which are used to restrict the access
of a class, constructor, data member and method in another class. Java supports
four types of access modifiers:
1. Default
2. Private
3. Protected
4. Public