+ 1

Why the 's' is capital in 'String' ?

21st Aug 2018, 4:14 PM
mn121
mn121 - avatar
6 Respostas
+ 1
Because it is defined in a class Am I right?
21st Aug 2018, 4:15 PM
mn121
mn121 - avatar
+ 5
because it is a class, and it is common programming style to make the first letter of a class uppercase.
21st Aug 2018, 4:57 PM
StealthyTaco
StealthyTaco - avatar
+ 2
yes , usually objects created have uppercase first letters as well, however not always. the out in System.out is an object that does not follow this style.
21st Aug 2018, 5:03 PM
StealthyTaco
StealthyTaco - avatar
+ 1
so, I can say that the same reason is for capital of s in 'System' .
21st Aug 2018, 4:59 PM
mn121
mn121 - avatar
+ 1
System.out is a variable, so it follows naming convention
22nd Aug 2018, 6:11 AM
BlazingMagpie
BlazingMagpie - avatar
+ 1
it is a class name, so S is capital, in System.out.println(),, out is static variable of type PrintStream , and println() is a method present in PrintStream class.
8th Sep 2018, 10:23 AM
Saurabh Singh
Saurabh Singh - avatar