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
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 Type | Default Value |
---|---|
short | 0 |
int | 0 |
long | 0L |
float | 0.0f |
double | 0.0d |
char | '\u0000' |
Answered By
28 Likes
Related Questions
Provide the declaration for two variables called xCoordinate and yCoordinate. Both variables are of type int and both are to be initialised to zero in the declaration.
List the size of primitive data types in Java.
Write a Java assignment statement that will set the value of the variable interestAmount to the value of the variable balanceAmount multiplied by the value of the variable rate. The variables are of type double.
Which integer and floating point data types take up the same number of bits in computer memory?