I am just beginning to program in Java and I noticed that String is the only type that starts with a capital letter.
Is there a reason behind this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By convention, Java types that start with an upper case are Objects, while those that start with a lower case are primitives.
A primitive cannot have a method attached to it, because there is no Object to hold the method. Also primitives cannot be subclassed, for the same reason.
Primitives also promote, which is something that Objects cannot do, as promotion changes the effective type of a primitive in ways that are not object oriented compatible.