+ 1
A numbers entry window appears and when I enter the numbers and apply it appears "error".why?
import java.util.Scanner; public class Program {Static Scaneer dear=new Scanner(System.in); public static void main(String[] args) {System.out.println("enter n1:"); int n1=dear.nextInt (); System.out.println("enter n2:"); int n2=dear.nextInt(); int resolt=n1+n2; System.out.println("r="+resolt); } }
1 Resposta
+ 15
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner dear=new Scanner(System.in);
System.out.println("enter n1:");
int n1=dear.nextInt ();
System.out.println("enter n2:");
int n2=dear.nextInt();
int resolt=n1+n2;
System.out.println("r="+resolt);
}
}