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
2 Respuestas
+ 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 🇮🇳
0
can you plz share the question @kara
10th Jan 2025, 3:12 PM
Alpit Gadhave
Alpit Gadhave - avatar
En tendencia hoy
.
1 Votes
What?
0 Votes
HTML
0 Votes
Web
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
help
0 Votes
AI
2 Votes
APIs
1 Votes