Senin, 16 Desember 2024

Java Primitive Data Types Default Values

The default values for the primitive data types in Java are as follows:

byte: 0
short: 0
int: 0
long: 0L
float: 0.0f
double: 0.0d
char: ‘\u0000’ (null character)
boolean: false
String (or any object)   null 


Notes

  • ‘\u0000’ is unicode escape sequences / unicode escape character.

Related Post

Tidak ada komentar:

Posting Komentar