Friday, 9 January 2009

Java Concept differences


ListArrayListLinkedListVectorArray
1FlexibleFlexibleFlexibleFixed
2UnsynchronizedUnsynchronizedSynchronizedUnsynchronized
SetHashSetLinkedHashSetTreeSet
1UnorderedInserted orderOrdered
2UnSynchronizedUnsynchronizedUnsynchronized
MapHashMapLinkedHashMapTreeMapHashTable
1Stored in HashHashTreeHash
2UnsynchronizedUnsynchronizedSynchronizedSynchronized
3UnorderedInserted orderOrderedUnordered
4Null allowedNull allowedNull allowedNull not allowed
ItrnIteratorIteratorListEnumerator
1One by oneOne by oneMore than one
2Remove EleRemove EleCan not
3UnidirectionalBidirectional
StringStringBufferStringBuilder
1ImmutableMutableMutable
2UnsynchronizedSynchronizedUnSynchronized

# Differences of Exceptions and Errors
Sl. No
Exceptions
Errors
1Exception is an abnormal condition raised while executing the programError 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 subclasseswhether an exception is raised or not finally block must executeAll 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 timeBlocked until further orders -resume()it is used to bring waiting thread to run able stateIt is used to bring all waiting thread to run able stateWaiting for thread to finish or die.

No comments:

Post a Comment