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

20th Nov 2020, 2:24 PM
Juan Libano
Juan Libano - avatar
9 Respostas
+ 2
Juan Libano , your method names are wrong. Write nextInt(), nextLine().
20th Nov 2020, 2:30 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 2
Juan Libano , everything works fine, I tried it.
21st Nov 2020, 8:14 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
Lo pude hacer correr en Símbolo del sistema
20th Nov 2020, 2:24 PM
Juan Libano
Juan Libano - avatar
0
I don't understand, when You Say the method name, Are You referring to "in.nextline" or "String in"?
20th Nov 2020, 2:52 PM
Juan Libano
Juan Libano - avatar
20th Nov 2020, 2:52 PM
Juan Libano
Juan Libano - avatar
0
Sorry "Scanner in" TheWh¡teCat 🇧🇬
20th Nov 2020, 2:53 PM
Juan Libano
Juan Libano - avatar
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".
20th Nov 2020, 7:39 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
TheWh¡teCat 🇧🇬 aaaahhhh okey, now i understand. Yeah You are right, but the code don't run when i put "run. Why?
21st Nov 2020, 8:12 PM
Juan Libano
Juan Libano - avatar
0
TheWh¡teCat 🇧🇬 i already corrected what You told me 🙃
21st Nov 2020, 8:14 PM
Juan Libano
Juan Libano - avatar