We create a single column in Object array
Multiple rows can be there
Each row on object array can hold one thing only as there is single column
That one thing we keep as a hastable. hashtable is like a bag
It can hold multiple values
sir... pls refer attachment...
is the logic right ???[refer attachment]
in 1 Dimensional array i put keys in column..is that fine ?
If i code as per the logic above[partial coding]..am getting ArrayoutOfBounds exception sir..
Please find attachments:
Got it sir...
Could you please explain : X[rowNumArray][0]=H; statement please....
Code:
----------
Hashtable<String,String>H=new Hashtable<String,String>();
Object[][]X =new Object[NumRows][1];
X[rowNumArray][0]=H;// <------Please explain in detail....
Issue:
Since H is name of hashtable & has key n value [2 entities].... We are assigning it to a 2D array.
How is that possible since we have not used H.get("<some key">)????????
http://stackoverflow.com/questions/5554734/what-causes-a-java-lang-arrayindexoutofboundsexception-and-how-do-i-prevent-it
Got it sir...
Could you please explain : X[rowNumArray][0]=H; statement please....
Code:
----------
Hashtable<String,String>H=new Hashtable<String,String>();
Object[][]X =new Object[NumRows][1];
X[rowNumArray][0]=H;// <------Please explain in detail....
Issue:
Since H is name of hashtable & has key n value [2 entities].... We are assigning it to a 2D array.
How is that possible since we have not used H.get("<some key">)????????
Hashtable<String,String>H=new Hashtable<String,String>(); //hash tables is created
Object[][]X =new Object[NumRows][1];//object created
X[rowNumArray][0]=H;// <------Please explain in detail....//in object X[row num][0] value of H will be loaded. so you can save many different hash tables in object.