Java is case sensitive -- by this, it is refering to the tokens. The method names, the class names, the variable names, the keywords, etc.
Strings are also case sensitive, but so what... strings should always be case sensitive, even if the language is not. It is kinda silly to not be able to write a program that distinguish case of strings.
In this case, it is a string, so... so what? ... but to answer your question, how the Boolean class behaves is defined in the JavaDoc. Here is the relevent excerpt.
public Boolean(String s)
Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true". Otherwise, allocate a Boolean object representing the value false.
Examples: new Boolean("True") produces a Boolean object that represents true. new Boolean("yes") produces a Boolean object that represents false.
i don't understand the Javadoc the only thing it does is confuse me more, i will ask this question to my instructor, dont worry thanks anyway
That is because you changed the question. Strings are case sensitive, which is why you second example says NO. The Boolean class parses strings to booleans in a case insensitive way, which is why your first example prints true.
You can't assume something is always case sensitive or case insensitive. You have to also know how they are implemented -- which is stated in the JavaDoc.
added an "e" to turn "not" into "note" for clarity [ June 26, 2008: Message edited by: Frank Carver ]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus