public class avarage
{
public void main(int subjectmarks)
{
System.out.println("Eneterd subject marks:"+subjectmarks);
}
}
Asked
Active
Viewed 43 times
0

Brian McCutchon
- 8,354
- 3
- 33
- 45

ritvik
- 11
-
I suggest googling the error message – Code-Apprentice Feb 13 '21 at 06:19
1 Answers
1
The compiler shows the above error because it cannot find the native main function signature. Just declare the integer subjectmarks
inside the main function and do not pass it as arguments in the main function, like below for example:
public class avarage {
public static void main(String[] args) {
int subjectmarks = <some-value>;
System.out.println("Eneterd subject marks:"+subjectmarks);
}
}

CapTen101
- 476
- 6
- 12
-
-
1Actually I meant error only, and not a warning. Thanks for pointing out. 'cause a warning usually gets compiled at least. – CapTen101 Feb 13 '21 at 06:29