Wednesday, 12 November 2014

TCS telephonic Interview questions

Class Order Sorting Duplicates Nulls Synchronised
ArrayList Y N Y Y N
LinkedList Y N Y Y N
Vector Y N Y Y Y
Map(Tree Map) Natural Order
But not insertion order
Y Y Keys-->No Nulls
Values-->Allows multiple
N
HashMap N N Y Key-->Allow only 1 Null
Values-->Allows multiple
N
HashTable N N Y N Y
Set(Tree Set) Natural Order Y N N N
HashSet No N N Y N
LinkedHashSet N N N Y N

List maintains Insertion Order
Map maintains Key-Value pair
Set does not allows Duplicates

-->All are not Sync except Vector and HashTable
-->All are not Sorted except TreeMap and TreeSet
-->All allows Null except TreeMap,HashTable,TreeSet
-->All allows Duplicates except Set related




What are Collection Objects in hibernate?

Collection typeMapping and Description
java.util.SetThis is mapped with a <set> element and initialized with java.util.HashSet
java.util.SortedSetThis is mapped with a <set> element and initialized with java.util.TreeSet. The sort attribute can be set to either a comparator or natural ordering.
java.util.ListThis is mapped with a <list> element and initialized with java.util.ArrayList
java.util.CollectionThis is mapped with a <bag> or <ibag> element and initialized with java.util.ArrayList
java.util.MapThis is mapped with a <map> element and initialized with java.util.HashMap
java.util.SortedMapThis is mapped with a <map> element and initialized with java.util.TreeMap. The sort attribute can be set to either a comparator or natural ordering.
Print Friendly Version of this pagePrint Get a PDF version of this webpagePDF

No comments:

Simplest way to display Server Time in JSP using js

THE BELOW CODE WORKS ONLY IN JSP : <html> <body > <table width="95%" border="1" cellpadding="1...