Results 1 to 5 of 5
Thread: Null
- 04-29-2009, 11:05 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 19
- Rep Power
- 0
Null
Hi, This code is fine no error but when i run this program all i get this output:
null null null null null null
null null null null null null
null null null null null null
null null null null null null
Java Code:public class examp { static String bookArray[] = new String[5]; static String dataArray[][] = new String [5][6]; public static void main(String args[]) { //String bookArray[] = new String[5]; //buildInstances(); //printReport(dataArray[k][0]); printReport(); }//main public static void buildInstances() { String dataArray[][] = {{"HELLO"," MY NAME"," IS"," Alex"," king","jadu"}, {"HELLO"," THIS IS"," SE"," LIN"," SECOND","jadu"}, {"HELLO"," DO U ST"," LL"," REM"," EMBER ","jadu"}, {"HELLO"," 4TH LIN"," IN"," PRO"," GRESS ","jadu"}, {"HELLO"," DOWNTOW"," N "," HUH"," HELLO ","jadu"}}; } public static void printReport() { for (int i=0; i<bookArray.length; i++) { System.out.println(dataArray[i][0]+dataArray[i][1]+dataArray[i][2]+dataArray[i][3]+dataArray[i][4]+dataArray[i][5]); //,dataArray([i][1]), dataArray([i][2]),dataArray([i][3]),dataArray([i][4])); } }//print report // } //main }
- 04-29-2009, 11:12 PM #2
Does bookArray have any data?
Question: in your code, when did you put data in bookArray?
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 04-29-2009, 11:18 PM #3
Member
- Join Date
- Apr 2009
- Posts
- 19
- Rep Power
- 0
so ok how do i put this in bookArray i'm so confuse
Java Code:bookArray[i] = dataArray[i][0]+dataArray[i][1]+dataArray[i][2]+dataArray[i][3]+dataArray[i][4]+dataArray[i][5]; ??
- 04-29-2009, 11:25 PM #4
Member
- Join Date
- Apr 2009
- Posts
- 19
- Rep Power
- 0
yeah i made one sample file to trace the problem but still no luck
- 04-29-2009, 11:29 PM #5
As you've commented out the method call, none of your arrays ever have anything assigned to them.
Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
Similar Threads
-
Check for null int
By SnarfSnarf in forum New To JavaReplies: 5Last Post: 01-30-2009, 11:12 PM -
Null Error
By scoleman123 in forum New To JavaReplies: 2Last Post: 09-19-2008, 04:04 PM -
Null value
By Michael in forum New To JavaReplies: 4Last Post: 06-15-2008, 06:25 AM -
Img.getWidth(null); gives -1 why?
By willemjav in forum New To JavaReplies: 0Last Post: 02-15-2008, 02:06 PM -
What is NULL
By bugger in forum New To JavaReplies: 1Last Post: 01-09-2008, 04:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks