0

Java. Method Scanner

Please, What is the problem of my code, I can not generate two user entries? import java.util.Scanner; public class myMargen { public static void main(String[] arg){ int a, b; Scanner S = new Scanner(System.in); System.out.print("Introduce value A: "); a = S.nextInt(); System.out.print("Introduce value B: "); b = S.nextInt(); } }

27th Aug 2018, 3:17 AM
Jorge Forero P
Jorge Forero P - avatar
1 Antwort
+ 2
First of all don't start the variables with a Upper case letter, second the code seems correct! Can you elaborate on what you were expecting?
27th Aug 2018, 5:00 AM
Chriptus13
Chriptus13 - avatar