ICSE Class 9 Computer Applications Question 14 of 14

Values and Data Types — Question 14

Back to all questions
14
Question

Question 14

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

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'