Tuesday, July 30, 2019

Q.Explain various Datatypes supported by Java by 124Study


Data Types in Java

  1. Primitive data types: The primitive data types include boolean, char, byte, short, int, long, float and double.
  2. Non-primitive data types: The non-primitive data types include Classes, Interfaces, and Arrays.

Java Primitive Data Types

Java Data Types
Data TypeDefault ValueDefault size
booleanfalse1 bit
char'\u0000'2 byte
byte01 byte
short02 byte
int04 byte
long0L8 byte
float0.0f4 byte
double0.0d8 byte

Boolean Data Type

Byte Data Type

Short Data Type

Int Data Type

Long Data Type

Float Data Type

Double Data Type

Char Data Type

0 comments:

Post a Comment