List | ArrayList | LinkedList | Vector | Array |
1 | Flexible | Flexible | Flexible | Fixed |
2 | Unsynchronized | Unsynchronized | Synchronized | Unsynchronized |
Set | HashSet | LinkedHashSet | TreeSet | |
1 | Unordered | Inserted order | Ordered | |
2 | UnSynchronized | Unsynchronized | Unsynchronized | |
Map | HashMap | LinkedHashMap | TreeMap | HashTable |
1 | Stored in Hash | Hash | Tree | Hash |
2 | Unsynchronized | Unsynchronized | Synchronized | Synchronized |
3 | Unordered | Inserted order | Ordered | Unordered |
4 | Null allowed | Null allowed | Null allowed | Null not allowed |
Itrn | Iterator | IteratorList | Enumerator | |
1 | One by one | One by one | More than one | |
2 | Remove Ele | Remove Ele | Can not | |
3 | Unidirectional | Bidirectional | ||
String | StringBuffer | StringBuilder | ||
1 | Immutable | Mutable | Mutable | |
2 | Unsynchronized | Synchronized | UnSynchronized |
# Differences of Exceptions and Errors
Sl. No
|
Exceptions
|
Errors
|
1 | Exception is an abnormal condition raised while executing the program | Error is a condition that doesn’t occur under normal conditions Ex: run out of memory, stack over flow. |
#Differences of final, finally and finalized.
Final
|
Finally
|
Finalized
|
We can apply the final keyword to variables, methods and classes. If a variable is declared as final we can’t change the values. if method is declared as final we can’t override. if class is declared as final we can’t subclasses | whether an exception is raised or not finally block must execute | All objects have finalized method. It is inherited from Object class. It is used to release system resources. Giving a chance to object free their resources before destroying. It is called prior to garbage collector. |
# Differences of functions
Wait() | Sleep() | Suspend() | Notify() | Notifyall() | Join() |
Blocked until certain condition occurs -notify() | Blocked for a specified time | Blocked until further orders -resume() | it is used to bring waiting thread to run able state | It is used to bring all waiting thread to run able state | Waiting for thread to finish or die. |
No comments:
Post a Comment