Drawing Class Practice, in Control Flow in Intro to Java | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Drawing Class Practice, in Control Flow in Intro to Java

Could someone help me figure out what is wrong with my code? For some reason I am not getting any output. import java.util.Scanner; public class Program { public static void main(int[] args) { Scanner myObj = new Scanner(System.in); int students = myObj.nextInt(); int pencils = myObj.nextInt(); System.out.println("Total:", students * pencils); } }

7th Dec 2022, 3:10 PM
Kara
1 Respuesta
+ 2
code have No Main method . For main method need String array as argument. Not int array. Next print statement : correct way is System.out.println( "Total: "+(students * pencils) ) ;
7th Dec 2022, 3:26 PM
Jayakrishna ūüáģūüá≥