Java/C++ Question

Rearrange the following code so that it forms a correct program that prints out the letter Q:

}
public static void main(String[] a) {
}
System.out.println("Q");
public class Q {

I do not know what to do in this question. Any help is appreciated
The code above is a complete program that prints the letter Q on the console. Somehow the code got scrambled.

1
2
3
4
5
6
7
public class Q
{
 public static void main(String[] a) 
 {
  System.out.println("Q");
 }
}
It says this for some reason

1. Compiler error: class Q is public, should be declared in a file named Q. java
2. public class Q
3. ^
Just save it as Q.java
Topic archived. No new replies allowed.