Results 1 to 2 of 2
Thread: Strange Error
- 04-18-2010, 09:28 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 59
- Rep Power
- 0
Strange Error
Hi. I have been through my program and removed lines that print unneccessary information to the screen.
I have used these lines of code.
//declare the char array
char[] stringArray;
//convert string into array using toCharArray() method of string class
stringArray = filename.toCharArray();
//display the array
for(int index=0; index < stringArray.length; index++)
System.out.println(stringArray[index]);
int check=((stringArray.length)-4);
And the program compiles perfectly.
I then took out the line System.out.println(stringArray[index]);
and then the program would no longer compile.
I got these error messages.
savefilepicker.java:102: '.class' expected
int check=((stringArray.length)-4);
^
savefilepicker.java:102: not a statement
int check=((stringArray.length)-4);
^
savefilepicker.java:102: illegal start of expression
int check=((stringArray.length)-4);
^
savefilepicker.java:102: ';' expected
int check=((stringArray.length)-4);
^
savefilepicker.java:102: not a statement
int check=((stringArray.length)-4);
^
savefilepicker.java:102: ';' expected
int check=((stringArray.length)-4);
^
6 errors
Why has this happened? Is this an error with Java? I don't see why not printing something to the screen would make such a difference!
- 04-18-2010, 09:31 PM #2
Member
- Join Date
- Apr 2010
- Posts
- 59
- Rep Power
- 0
Similar Threads
-
Strange Problem
By Aseem in forum JDBCReplies: 5Last Post: 02-12-2010, 07:46 AM -
Strange, 'Cannot find symbol' error
By mhouldridge in forum Advanced JavaReplies: 6Last Post: 09-06-2009, 04:54 PM -
strange Error message
By little_polarbear in forum New To JavaReplies: 4Last Post: 08-25-2008, 11:45 PM -
System.in.read(); strange error!
By kantze in forum New To JavaReplies: 2Last Post: 03-19-2008, 01:44 PM -
Strange error message "Source not found"
By ppayal in forum EclipseReplies: 0Last Post: 11-25-2007, 06:19 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks