
What does the error means when my error is class ListCharacters is public, should be declared in a file named ListCharacters.java public class ListCharacters
^**strong text**
My code is :
public class ListCharacters
{
public static void main(String[] args)
{
for( char c = 0; c < 128; c++)
if (c != 26 ) // ANSI Clear screen
System.out.println("value: " + (int)c +" character: " + c);
}
}

This error occurs when you have declared a class public but save the file with another class, if you have two classes in your file.Anyways, simply create a new java file and put the given code and save the filename with ListCharacters.java
public class ListCharacters {
public static void main(String[] args) {
for( char c = 0; c < 128; c++) if (c != 26 )
System.out.println("value: " + (int)c +" character: " + c);
}
}

No I have Got The Answer Its Not Like That The Problem Was In My JDK Version ..
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.