KnowledgeBoat Logo

Computer Applications

What is variable initialisation in Java? What are the default values of the following type of variables? short, int, long, float, double, and char.

Values & Data Types Java

ICSE

53 Likes

Answer

Variable initialisation means assigning value to a variable for the first time. Below are the default values of the different data types:

Data TypeDefault Value
short0
int0
long0L
float0.0f
double0.0d
char'\u0000'

Answered By

28 Likes


Related Questions