|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Problem with Hashtable values
Hi,
I am getting problem with hashtable. I am putting values dynamically into the hashtable and then after i am redefining my value. Means i am putting vector in to the hashtable for every different key. I am clearing my vector after every entry into the hashtable. Whenever i am retreiving the data my hashtable retrieves values. But the value in hashtable gives problems and gives zero size vector.. How can i use my hashtable and vector. Example code : Hashtable indhash=new Hashtable(); Vector indvec1=new Vector(); String st1=null; for(int i=0;i<indstr.length;i++) { if(st1==null) st1=indstr[i][0]; if(!st1.equals(indstr[i][0])) { indhash.put(st1,indvec1); st1=indstr[i][0]; indvec1.clear(); indvec1.addElement(indstr[i][1]); } else { indvec1.addElement(indstr[i][1]); } if(i==indstr.length-1) { indhash.put(indstr[i][0],indvec1); indvec1.clear(); } } after this when retriving my hashtable gives zero length vector from hastable. Please help Me. Its' Murthy |
|
#2
|
||||
|
||||
|
Is this C ?
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > Problem with Hashtable values |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|