0
Tengo un código que no puedo hacer correr en esta plataforma, porque?
import java.util.Scanner; public class Suma { public static void main(String[] args) { Scanner in = new Scanner (System.in); String nombre = ""; int numUno = 0, numDos = 0, resultado = 0; System.out.println ("cual es tu nombre?"); nombre = in.nextline(); System.out.println("Dame el primer valor para tu suma:"); numUno = in.nextint(); System.out.println("Dame el segundo valor para tu suma:"); numDos = in.nextint(); resultado = numUno + numDos; System.out.println ("hola " + nombre + " el resultado de tu suma es: " + resultado); } }
9 Respostas
+ 2
Juan Libano , your method names are wrong. Write nextInt(), nextLine().
+ 2
Juan Libano , everything works fine, I tried it.
0
Lo pude hacer correr en Símbolo del sistema
0
I don't understand, when You Say the method name,
Are You referring to "in.nextline" or "String in"?
0
Sorry "Scanner in" TheWh¡teCat 🇧🇬
0
Juan Libano , I mean that in nextLine method "L" is uppercase letter, you wrote it with "l", same about nextInt method "I" should be uppercase instead of "i".
0
TheWh¡teCat 🇧🇬 aaaahhhh okey, now i understand. Yeah You are right, but the code don't run when i put "run. Why?
0
TheWh¡teCat 🇧🇬 i already corrected what You told me 🙃