HashTable in Java

java-thumbnail

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

java-thumbnail

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

java-thumbnail

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. […]

LinkedList in Java

java-thumbnail

LinkedList is not most commonly used class for storing the values. The LinkedList class extends AbstractSequentialList and implements the List interface. It stores the data using linked-list data structure. This class has two constructors, With empty parameters – LinkedList() and With Collection object as the parameter – LinkedList (Collection c) Some of the important features of […]

JSP API

java-ee-thumbnail

Java EE Tutorials JSP Tutorials Recommended Books for Java Server Pages (JSP) This tutorial lists down the API’s used in the Java Server Pages (JSP) programming. API stands for Application Programming Interface that allows programmers for building software applications in java. JSP API is categorized into following packages: Packages Description javax.el It provides classes and interfaces […]

JSP Redirect

java-ee-thumbnail

Java EE Tutorials JSP Tutorials Recommended Books for Java Server Pages (JSP) Redirect is used to move or redirect response to another resource. The resource may be servlet , jsp or html file. In this tutorial we will see an example of how to redirect in JSP. We can do PageRedirect using the sendRedirect() method, which […]

OCPJP 6 Mock Exam -15

ocpjp-6-thumbnail

1 . Which of the following can prevent a thread from executing? A call to its pause method A call to Thread.yield() Another thread is given higher priority A call to its halt() method 2 . Which of the following represent correct syntax for assertions? assertion(b==false); assert (b==false); assert() b==false; if(b!=true) assert; 3 . What […]

OCPJP 6 Mock Exam -14

ocpjp-6-thumbnail

1 . Given Answer class behaves like some a File it has a Vector, a color, some boolean variable.What is the correct declaration? import public private Vector Serializable File Color extends boolean implements 2 . Some design issues: The following description applies to a class: given someclassname behaves as somesuperclassname and it has some fields […]

OCPJP 6 Mock Exam -13

ocpjp-6-thumbnail

1.What will be the output? Choose the one below: True False 2 . What will be the output? Choose the one below: True False 3 . What will be the output? Is the line marked “lots of code” ever reached? Yes No 4 . What will be the output? Choose the one below: The code […]

OCPJP 6 Mock Exam -12

ocpjp-6-thumbnail

1 . What will be the output? Choose the one below: the code will compile an print “Equal”. the code will compile an print “Not Equal”. the code will cause a compiler error. 2 . What will be the output? Choose the one below: the code will compile an print “Equal”. the code will compile […]