Answer the question
In order to leave comments, you need to log in
I'm starting to program in Java, what's wrong with this program?
I started programming in Java, I solve problems in informatics and study there, but the program does not compile on ideone.com and on other compilers.
What's wrong?
package myprogram;
import java.io.PrintStream;
import java.util.Scanner;
public class myprogram; {
public static Scanner in = new Scanner(System. in );
public static PrintStream out = System.out;
{
int a;
a = in .nextInt();
out.print(a / 10);
}
}
Answer the question
In order to leave comments, you need to log in
the program does not compile on ideone.com and on other compilers, what is wrong?
Doesn't compile due to ; after the class name
public class myprogram ; {
After compilation will not work due to the absence of the main method
and to public static void main(String[] args) , you need to add trhrow IOExceptions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question