+ 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
6 Respostas
+ 1
Thank you everyone đđ
+ 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.
+ 1
https://code.sololearn.com/cDqNCq3n554B/?ref=app
LĂžrd Ăsh , look at the corrected code.
+ 1
We have to mention the String[] args in the main method
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);
}
}
0
Try this code will help you