Results 1 to 2 of 2
Thread: Array problems..
- 04-17-2009, 06:38 AM #1
Member
- Join Date
- Apr 2009
- Posts
- 1
- Rep Power
- 0
Array problems..
can someone tell me whats the problem in here or problem may occur in this code?? thanks alotz..
import java.util.StringTokenizer;
import java.util.*;
public class testStknzArrList {
public static void main(String args[]) {
ArrayList aL = new ArrayList();
String str = "Model ;Dell;Class ;Inspiron;Chipset;Core2duo;Ram ;2G;H/d ;250G;Graph/c;Ati newest.ver.";
String[][] Laptop = new String[1][2];
StringTokenizer stknz = new StringTokenizer(str,";");
while(stknz.hasMoreTokens()) {
Laptop[0][0] = stknz.nextToken();
Laptop[0][1] = stknz.nextToken();
aL.add(Laptop);
Laptop = new String[1][2];
}
System.out.println("Element : " + aL.size());
for(int i=0; i<aL.size();i++) {
String[][]temp = (String[][]) aL.get(i);
System.out.println(temp[0][0] + "-||-" + temp[0][1]);
}
}
}Last edited by smokeviolent; 04-17-2009 at 06:46 AM.
- 04-17-2009, 06:45 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
What's the question you have, any errors you get? It's easy to us, if you can explain your question more clearly than this.
Similar Threads
-
Array Index problems
By ragnor2004 in forum New To JavaReplies: 4Last Post: 03-26-2009, 07:53 PM -
Array problems
By Hosticus in forum New To JavaReplies: 2Last Post: 01-18-2009, 02:48 AM -
Problems displaying and array of JPanels
By dousedfirepants in forum New To JavaReplies: 3Last Post: 11-13-2008, 05:47 AM -
array problems need your help ASAP!
By notherand in forum New To JavaReplies: 1Last Post: 06-29-2008, 08:59 PM -
problems with array index
By mary in forum New To JavaReplies: 2Last Post: 08-01-2007, 04:30 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks