Why is the program not running? What is the mistake here? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is the program not running? What is the mistake here?

Please someone correct my program by telling me the mistake that I am not able to figure out. https://code.sololearn.com/ckucIrI3iNZz/?ref=app

31st Aug 2022, 6:08 AM
Lørd Ãsh
6 Answers
+ 1
Thank you everyone 😊😊
31st Aug 2022, 1:13 PM
Lørd Ãsh
+ 2
The main method needs to follow a specific signature for it to be considered as the program's entry point. + public, static access modifiers are there + void return type is also specified Just one thing missing. The main method accepts a String array as argument. Your main method lacks this one, as others had suggested.
31st Aug 2022, 7:30 AM
Ipang
31st Aug 2022, 6:33 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
We have to mention the String[] args in the main method
1st Sep 2022, 4:58 AM
Kailash Yandrapu
0
import java.util.Scanner; public class Program { public static void main(String[] args) { //this program to calculate rectangle area // Scanner x = new Scanner(System.in); int a, b, c; System.out.println("enter length"); a = x.nextInt(); System.out.println("enter width"); b = x.nextInt(); c = (a*b); System.out.printf("the area is %d", c); } }
31st Aug 2022, 7:10 AM
Harsh Nama
Harsh Nama - avatar
0
Try this code will help you
31st Aug 2022, 7:10 AM
Harsh Nama
Harsh Nama - avatar