+ 2
what am I doing wrong
I would like the scanner to gather int data and then print it out but it's not working what am I doing wrong? ; ( đ public class Program { public static void main(String[] args) { Scanner n = New; Scanner(nextint()); System.out.println(n.Nextint()); } }
4 Answers
+ 7
import java.util.Scanner
public class Program
{
public static void main(String[] args)
{
Scanner n =new Scanner(System.in);
System.out.println(n.nextInt());
}
}
+ 3
or you can use like below...
import java.util.Scanner;
public class Program{
public static void main(String[] args){
Scanner n;
n = new Scanner(System.in);
System.out.println(n.nextInt());
n.close();
}
}
+ 2
THANKS!!!!!
0
public class Program
{
public static void main(String[]arts)
{
Scanner n = new Scanner(System.in);
int x = n.nextInt();
System.out.println(x);
}
}