Java Data Types Flashcards
Equals method of a primitive wrapper class
- symmetric => a.equals(b) returns same as b.equals(a)
- transitive => if a.equals(b) and b.equals(c) return true, then a.equals(c) returns true.
- reflexive => a.equals(a) return true.
Boolean
constructors
Boolean class has two constructors - Boolean(String) and Boolean(boolean) . The String constructor 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.
Final variable
Must be initialized either in an instance block or in a constructor.
Modifiers
static and final
static and final are valid modifiers for both member field and method declarations within a class.
Modifiers
transient and volatile
transient and volatile modifiers are only valid for member field declarations.
Modifiers
abstract and native
abstract and native are only valid for member methods.