1. Why java does not support multiple inheritance ?
Answer :- To say why java doesn't support inheritance directly like c++ should be the diamond problem faced by c++,(Diamond problem is an ambiguity that arises when two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A
(and does not override it), and B and C have overridden this method differently, then via which class does it inherit: B, or C?)
2. JVM crash is an Error or Exception.?
Answer:- JVM crash is an Error as a normal developer as we cannot handle it, but its exception for JVM developer as they can fix it.
Answer:-
4. Collections in Java?
5. Difference between Error and Exception?
Answer:- Error cannot be handle and Exceptions can be handle
6. Difference between Abstract Class and Interface?
7. Difference between Data Hiding and Data Encapsulation?
8. What type of Inheritance does JAVA support?
9. Abstract Class Live Example?
Answer :- To say why java doesn't support inheritance directly like c++ should be the diamond problem faced by c++,(Diamond problem is an ambiguity that arises when two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A
(and does not override it), and B and C have overridden this method differently, then via which class does it inherit: B, or C?)
2. JVM crash is an Error or Exception.?
Answer:- JVM crash is an Error as a normal developer as we cannot handle it, but its exception for JVM developer as they can fix it.
3. Print “Hello World!” Without Main Method in Java?
Answer:-
public class Testing {
static
{
System.out.println("Hello World");
}
public static void main(String[] args)
{
}
}
4. Collections in Java?
- Interfaces
- Iterable
- Collection
- Generic Collections
- List
- Set
- SortedSet
- NavigableSet
- Map
- SortedMap
- NavigableMap
- Queue
- Deque
- Stack
- hashCode() and equals()
- Sorting
5. Difference between Error and Exception?
Answer:- Error cannot be handle and Exceptions can be handle
6. Difference between Abstract Class and Interface?
7. Difference between Data Hiding and Data Encapsulation?
8. What type of Inheritance does JAVA support?
9. Abstract Class Live Example?
Comments
Post a Comment