ICSE Class 10 Computer Applications Question 17 of 25

Values and Data Types — Question 17

Back to all questions
17
Question

Question 17

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'