Help with Java, I'm a begginer!!! | Sololearn: Learn to code for FREE!

0

Help with Java, I'm a begginer!!!

import java.util.Scanner; class Program { public static void main(String[] args) { Scanner ent = new Scanner(System.in); System.out.println ("Ingresa un número entero:"); Int nent = ent.nextline (); System.out.println(nent); } } I can't find the mistake... It supposed to be at 8 line HELP"!!!

9/8/2018 9:53:38 PM

Yisney Soto

2 Answers

New Answer

0

"int nent = ent.nextLine();" in "nextLine()" must be "nextInt()" for integers, if you want only numbers in your user input.

0

Thank you guys