+ 1

Is it compulsory method name start with small letter &class name capital letter

class MyClass { static int sum(int val1, int val2) { return val1 + val2; } public static void main(String[ ] args) { int x = sum(2, 5); System.out.println(x); } }

2nd Sep 2019, 1:52 PM
LOKESHA E J
LOKESHA E J - avatar
2 Respuestas
+ 2
It is a kind of standard. It makes your code more readable. And most of the IDEs uses syntax highlighting. For example in the code playground classes are blue. If you use capital letters for variable names or methods they would get also blue. I think it is clear that it would be very confusing.
2nd Sep 2019, 2:15 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Tnx for clear my doubts
2nd Sep 2019, 2:17 PM
LOKESHA E J
LOKESHA E J - avatar