0

FIND THE ERROR IN THIS PROGRAM..

class program{ public static void main(string[] args) { int x=max(7, 8); System.out.println(x); } static int max(int a, int b) { if(a>b) { return a; } else { return b; } } }

17th Jan 2022, 12:08 PM
Udhay Shankar.D
Udhay Shankar.D - avatar
2 Answers
+ 5
public static void main(String[] args) 'string' is not recognized as type, it should be 'String' ...
17th Jan 2022, 12:27 PM
Ipang
+ 2
Hello Udhay Shankar.D Your code should work. Which error message to you get?
17th Jan 2022, 12:25 PM
Denise Roßberg
Denise Roßberg - avatar