explain primitive data types in javajavas


Explain primitive data types in java?

Java's primitive data types are extremely similar to those of C. They involve boolean, byte, short, long, int, float, double, and char. The boolean type has been added. Therefore the implementation of the data types has been substantially cleaned up in various ways.

1. Where C and C++ go away a number of issues to be machine and compiler dependent (for instance the size of an int) Java specifies everything.
2. Java prevents casting among arbitrary variables. Only casts among numeric variables and among sub and superclasses of the same object are permitted.
3. All numeric variables in Java are signed.

sizeof isn't essential in Java because all sizes are precisely described. For instance, an int is always 4 bytes. This might not seem to be adequate while dealing with objects in which aren't base data types. Therefore even if you did know the size of a particular object, you couldn't do anything with it anyway. You cannot convert an arbitrary object within bytes and back again.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: explain primitive data types in javajavas
Reference No:- TGS0284261

Expected delivery within 24 Hours