+ 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); } }
2 Antworten
+ 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.
+ 2
Tnx for clear my doubts