I have studied about java datatype very earlier and found that they are primitive type. As java is object oriented but its data types are not. why is it so?
See Question&Answers more detail:osI have studied about java datatype very earlier and found that they are primitive type. As java is object oriented but its data types are not. why is it so?
See Question&Answers more detail:osIt is said that everything in Java is an Object at the same time the Java Programming Language is meant to be simple. Since the primitive data types consume less memory and can be accessed faster, they are not objects. The equivalent Wrapper classes are also available in java like "Integer" "Short" etc. They can be used as objects if you want. However, the wrapper classes will be stored in Heap and they are slow.