What is protected? |
Access modifiers: Public: The classes, methods, or variables which are defined as public, can be accessed by any class or method. Protected: Protected can be accessed by the class of the same package, or by the sub-class of this class, or within the same class. Default: Default are accessible within the package only. By default, all the classes, methods, and variables are of default scope. Private: The private class, methods, or variables defined as private can be accessed within the class only. |
What is tranzient? |
What is volatile? |
What is method? |
What is loop? |
What is if - then? |
What is variable? |
What is expression? |
What is while - do while? |
What is || and && in an expression? |
What are primitive types? |
What are keywords? |
What is final? |
What is unboxing? |
How you can compare Integers? |
How you can compare Doubles? |
What is the purpose of garbage collection in Java and when it is used. (when you can use finalize) |
What is singleton class? |
what is a static class variable? |
Why is string class considered immutable? |
What is immutable? |
Why is string buffer called mutable? |
Define inheritance. |
What is polymorphism? |
overloading and overriding |
Exceptions (types, try - catch, when you can get exception) |
What is the bean? |
What is the Pojo? |
What is design pattern? |
Where are the static primitive type variables stored? |
HashCode and Equals (related to String / Integer as well) |
Method Overloading | Method Overriding |
---|---|
1) Method overloading increases the readability of the program. | Method overriding provides the specific implementation of the method that is already provided by its superclass. |
2) Method overloading occurs within the class. | Method overriding occurs in two classes that have IS-A relationship between them. |
3) In this case, the parameters must be different. |