DATAYPE AND WRAPPER CLASS
- Java language support the concept of primitive datatype like c or c++
- If a language support primitive datatype that language cannot be a pure object oriented programming language.
- To make java language pure object oriented it supports the concept of wrapper class.
- As java language support the concept of architecture neutral the size of primitive data type is fixed for all the environment.
- For each datatype java provide a predefined class ,technically known as wrapper class in java.
- Wrapper class are used to convert data type an object .In java primitive datatype are not object they don’t belongs to any class.
- All the wrapper class present in java.lang package.
- Wrapper class are also used for type conversion.
- All the wrapper class are final class it can’t be inherited.
NOTE Signed and unsigned keyword are not available in java like c or c++,by default datatype is always signed in nature.
PARSEBYTE( ) –This is a static method present in byte wrapper class which is used to convert a string to a byte type.
TOSTRING( )- This is a predefined static method present in each wrapper class which convert a datatype to string format.
charAt( )- This method is used to get character of a specific index.
ToBinaryString( )- This method is convert integer to binary and return value into a string format.
toOctalString( )- This method is convert integer to octal and return value into a string format.
toHexaString( )-This method is convert integer to hexadecimal and return value into a string format.
CurrentTimeMillis( )-It is a predefined static method present in system class which always return the system time in mill sec format.