typesafety

Showing posts with label typesafety. Show all posts
Showing posts with label typesafety. Show all posts

ArrayList vs LinkedList vs Vector


ArrayList vs LinkedList vs Vector ArrayListLinkedListVectorData structureIndex-based  dynamic arrayDoubly linked listGrowable arrayIncrement size50%No initial size100%Traverse Uses iteratorUses iteratorUses enumerationMemory usageLess memory usageMore memory usageAccessibilityRandom...

Array vs ArrayList


 ArrayArrayListFixed-sizeSize is not fixedNot type-safeType-safeAllow both primitives and objectsDoesn't allow primitives. But after Java 5 auto-boxing will convert primitives to objectsType safety means the compiler will validate the types while compiling and throw an error if you do anything...