Compressing and Uncompressing of the files is one of the common utility we use in our daily life. If you are using windows, using WinZip is very common to compress the files and sent to others. The advantage of compressing the files is to save the memory occupied for the file in the disk. It …
OCPJP 6 Mock Exam -16
1 . What will be the output? Choose the one below: Compile time error at line 10 Compilation and output of 123 Compilation and output of the digits “1”, “2” and “3”, but the order can’t be determined Compilation and output of onetwothree Compilation but runtime error at line 10 2 . The following is …
How To Use JavaBeans in JSP?
Java EE Tutorials JSP Tutorials Recommended Books for Java Server Pages (JSP) JavaBeans are simple classes that are used to develop dynamic WebPages. JavaBeans are required to create dynamic web pages by using separate java classes instead of using java code in a JSP page. It provides getter and setter methods to get and set values …
Session Tracking in JSP
Java EE Tutorials JSP Tutorials Recommended Books for Java Server Pages (JSP) Sessions are mechanism for storing client data across multiple HTTP requests. From one request to another user the HTTP server does not maintain a reference or keep any record of client previous request. HttpSession Methods getAttribute : it returns stored value from session …
How To Sort Java Object Using Comparable And Comparator?
This tutorial shows how to use java.util.Comparator and java.lang.Comparable to sort a Java object based on its property value. Here I have created Employee object with Name and Age properties, we will be able to sort the list of objects based on the values in the property’ Lets look at the example. Employee.java ComparatorExample.java Output …
HashTable in Java
HashTable class was originally added as part of java.utill package and extended the Dictionary class. From Java 2, it is re-engineered to implement the Map interface and made as part of the collections framework. HashTable is similar to HashMap except that HashTable is synchronized. It is very much similar to HashMap, stores the key-value pairs. …
HashMap in Java
HashMap uses the hash table to implement the Map interface. Map is key-value pair where key is the reference and value is the actual data. HashMap is very extensively used in the projects when key-value type data is stored. This doesn’t ensure the order of insertion. This class extends the AbstractMap and implements the Map …
HashSet in Java
HastSet is one of the classes available with collections package and it extends the AbstractSet and implements the Set interface. This uses the hash table for storing the values. Hash table internally using hashing mechanism to store the values. In the hashing technique, information is uniquely identified using the hash code. HashSet supports four constructors. …