My Java Learnings

Collection


set - no duplicate elements


list






HashSet


The iterators returned by this class's iterator method are fail-fast.


ListIterator can be used to add/modify elements in a list

 
Suppose you have a Collection, c, and you want to create another Collection containing the same elements,


but with all duplicates eliminated. The following one-liner does the trick


Collection noDups = new HashSet(c);


TreeSet , alphabetically stores the contents.


Vector is synchronized


ArrayList is not synchronized


Collections.synchronizedList (new ArrayList or any collection object for that case)


Map : No duplication


HashMap : no duplicates allowed


The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls


Collections.sort(list);


Actually String and Date both implement the Comparable


Comparator: method compare





Internationalization






MessageBundle.properties


MessageBundle_en_US.properties


ResourceBundle.getBundle("MessageBundle",locale)


error messages , GUI labels , date , currencies ,


ListResourceBundle


NumberFormat , to format numbers , currencies, date formats, time formats as per current locale


MessageFormat


MessageBundle , all messages specific to a locale can be placed here.


For Example : MessageBundle_en_US.properties

Some More Questions

How does java internally behave ?


System.out.println what is out ? PrintStream

new file(), Transient variables are not persisted.

Suppose If we have variable 'I' in run method,

If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?
 
Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA ?


When is the JVM invoked ?
JVM is involved when the "JAVA" command is executed by the application / java program

Why does EJB needs two interface( Home and Remote Interface) ?

Servlets


What do mean stateless protocol ? HTTP ? What do we do for maintaining the state

What is the difference in between doPost and doGet methods ?

Difference between rmi and ejbs ?

What is iiop ?

Why cant we invoke methods on ejbs directly ?

Why define Remote Interfaces ?

What is the functionality stubs and skeletons ?
JDBC insert call ..what is the default behaviour.