Ads Sponsored By Google :)

Tuesday, 22 January 2013

using|Dicitionary class|implementation in java example

Dicitionary in java Dicitionary class in java Dicitionary in java example Using Dicitionary class in java Dicitionary class implementation in java

    Dictionary :
                                  Dictionary is one of the 2 – D legacy collection frame work abstract 
class.An object of Dictionary class organizes the data in the form of (key,value) pair. 
Dictionary class functionality is more less similar to Map interface, but dictionary class 
object belongs to synchronized and Map interface belongs to Non-synchronized.
Dictionary calss play a back ground role in providing  abstract methods to both HashTable and Properties  class.

   MethodsOf Dictionary Class :
         1)      Public int size()
         2)      Public Boolean isEmpty()
         3)      Public Boolean put(Object kobj,Object vobj)
         4)      Public Object get(Object kobj)
         5)      Public void remove(Object kobj)
         6)      Public void removeAll()
         7)      Public Enumeration keys()
       As above all methods from 1 to 6 is used for finding size, empty or not, inserting, deleting, retrieving particular elements. One important method is keys().
   Public Enumeration keys() :
                   This method is used for retrieving or extracting the set of keys from any legacy 2 – D  collection frame work variable and pass these set of keys through get() method and obtain set of value’s of value.

The Following Coding which illustrate the keys()
     Enumeration e=D.keys();
      Object kobj=e.nextElement();
      Object vobj=e.get(kobj);
      Integer io=(Integer)kobj;
      Float fo=(Float)vobj;

    Data Extraction Interfaces are as follows :

          1- D and 2-D Collection Frame work classes are 

        To read the values dynamically from keyboard their is a class.
                 Java.util.Scanner or Scanner class

No comments:

Post a Comment