+ 2

Scanner

hi everyone, im trying to write a code, but something is wrong. can you help me? import java.util.Scanner; public class Tester { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int x; x = scan.nextint(); long l; l = scan.nextLong(); int width, height, area, peri; width = 8; height = 5; area = width * height; peri = 2 * (width + height); System.out.println ("Area:" + area + " " + "Peri:" + peri); } }

1st Mar 2017, 6:22 PM
Shani
4 Answers
+ 14
@luka long is a data type like int and double.
1st Mar 2017, 6:57 PM
Jafca
Jafca - avatar
+ 3
Thank you Luka, I didn't pay attention that nextint must be with capital I. So thank's a lot.
1st Mar 2017, 8:34 PM
Shani