Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie, what is wrong with this code?

Status
Not open for further replies.

DGA15

Programmer
Aug 19, 2000
40
US
Why do I get this error? (Using JBuilder 6 Personal Edition)

error and code sample below:

ERROR:
"ListCharacters.java": Error #: 203 : illegal start of type at line 16, column 40

CODE Sample:
package listcharacters;
import java.io.*;
/**
* <p>Title:ListCharacters </p>
* <p>Description: Demonstrates a For Loop by printing all the ASCII characters</p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: from ,Thinking in Java' , pg#174</p>
* @author WBG
* @version 1.0
*/

public class ListCharacters {
public static void main(String[] args){
for (char c = 0; c < 128; c++){
if (c != 26 ) //skip ANSI ClearScreen
System.out.println(&quot;Value: &quot; + int(c) +
&quot; Character: &quot; + c);
}

}
}
 
Please disregard this post. I found my problem... in the System.out.println I had failed to properly cast c as an integer. I had int(c) instead of (int)c.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top