SCJP Study Notes
Language Fundamentals
- Unicode literal character must be enclosed in single quotes and must begin with \u.
- Unicode uses 16-bits to represent a character.
- UTF uses as many bits as are needed to represent a character.
- Importing is strictly a compile time function and slightly increaces the compile time but it has no effect on class loading or on any other runtime function.
- A native method cannot be abstract, but it can throw exceptions.
- A local variable will shadow a class level variable
- The equals method can not be applied to primitives.
- Objects that are equal according to the equals method must return the same hashCode value.
- If two objects are not equal according to equals they are not required to return different hashCode values.
- An interface can be converted to an interface tpye or to Object.If the new type is an interface, it must be superinterface.
- A class type can be converted to a class type or to an interface type. If converting to a class type,the new type must be a superclass of the old type.
If converting to an interface type, the old class must implement the interface. - An array may be converted to another array,provided the element types of the arrays are compatible.
- You can always cast between an interface and a non-final object.
- When an array is constructed, its elements are automatically initialized to their default values.
- Local variables must be explicitly initialized before being used.
- Local parameters and arguments are allocated space on the stack and are discarded when the method exits, but objects are
allocated on the heap and have a longer life time. - An array of primitive type can not be cast to an array of a different primitive type.
- The maximum byte value in hexadecimal format is 7f and in decimal format is 127.The minimum byte value in hexadecimal format is 80 and in decimal format is -128.
The byte value of decimal -1 is ff in hexadecimal.
