Java/C++ Question

Jan 9, 2017 at 7:25pm
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
Jan 9, 2017 at 8:35pm
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");
 }
}
Jan 13, 2017 at 9:39pm
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. ^
Jan 14, 2017 at 9:13am
Just save it as Q.java
Topic archived. No new replies allowed.