- 4
Class atributes second question - naming convention !
In second question user has to fill missing lines and it is like people human = new people(); Please put correct naming convention for classes (first uppercase letter) Thank you
5 ответов
+ 3
By definition; a convention is not an obligation, so don't following them, isn't uncorrect ^^
+ 1
@neon_cabbage
Actually, convention in JAVA programming IS to have the first letter capitalized for class, camelCase for fields.And yes, I know how and why is that convention called camel case. Thank you. And as I said it is not incorrect but it is a bad habit and you don't want to learn it as a beginner. And convention that you prefer is not one that is recommended in Java, although you can use it. And yes, educate yourself:
http://www.oracle.com/technetwork/java/codeconventions-150003.pdf
0
It Is not uncorrect it is BAD HABBIT you don't want to learn because it can lead to confusion. If you want to become a programmer, beleive me you HAVE to stick to it. At eadt to one of conventions...
0
@Ladislav
Great. Even more crap to figure out. I kind of wish they'd teach some of that stuff here, but oh well. I guess that's what you meant originally.
- 1
The convention isn't even to have the first letter capitalized. The "convention" is called camelCase, and it is done by leaving the first word uncapitalized, and every word after it is capitalized. For example, myClass, myMethod, etc.
So if it's just one word, it's not capitalized.
Another convention (that I prefer, to a point): snake_case, where you separate words with underscores. For example, my_method, my_class, etc.