+ 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); } }

27th Jan 2018, 12:51 PM
Mustafa Ali
Mustafa Ali - avatar
1 Antwort
+ 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); } }
27th Jan 2018, 1:10 PM
Gaurav Agrawal
Gaurav Agrawal - avatar