StringBuilder in Java

We will find an answer for the following questions What is StringBuilder Available Constructors Commonly used methods StringBuilder Java StringBuilder class is used to create a mutable (modifiable) string. The Java StringBuilder class is the same as the StringBuffer class except that it is non-synchronized. So its not thread-safe and can’t be Read more…

HttpSession

When a client visits the webapp for the first time, and HttpSession is obtained for the first time the servlet container creates a new HttpSession object, generates a long and unique ID (which you can get by session.getId()), and store it in the server’s memory. The servlet container also sets Read more…

ServletContext and load-on-startup

What happens behind the scene when Web Application is deployed in Web Server like Tomcat? ServletContext It provides a set of methods that a servlet uses to communicate with its servlet container. There is one context per “web application” per Java Virtual Machine. A “web application” is a collection of servlets Read more…

Hashtable in Java

We will find out answers for the following question What is Hashtable Common methods available Hashtable HashTable is a member of the Java Collection Framework as it implements Map Interface. HashTable implements a hash table, which maps keys to values. Any non-null object can be used as a key or Read more…

HashMap in Java

We will find out answers for the following question What is HashMap in Java Common methods available HashMap HashMap is a Map-based collection class that is used to store Key & value pairs. It is denoted as HashMap<Key, Value> or HashMap<K, V>. This class makes no guarantees as to the Read more…

Hashing Technique

We will find out what are Hash functions, Hashcode, Collision and Rehashing. Since HashMap and HashSet both use Hashing Technique we will also be able to answer Internal working of HashMap Internal working of HashSet Hash functions Hash functions are used in hash tables, to quickly locate a data record (e.g., Read more…