Challenge: Variable Declaration
Solve the given problem by following the steps mentioned in the problem statement.
We'll cover the following
Problem statement
-
Declare a
byte
type variable, name it age, and assign it a value of 10. -
Declare a
short
type variable, name it height, and assign it a value of 30000. -
Declare an
int
type variable, name it distanceBetweenTwoSatellites and assign it a value of 1000000000. -
Declare a
long
type variable, name it distanceBetweenTwoGalaxy and assign it a value of 10,000,000,000L.. -
Declare a
float
type variable, name it rateOfInterest, and assign it a value of 6/5f. -
Declare a
double
type variable, name it rateOfHike and assign it a value of 456/123d. -
Declare a
char
type variable, name it capitalA, and assign it a value of ‘A’. -
Declare a
boolean
type variable, name it isPossible, and assign it a value of true.
Get hands-on with 1200+ tech skills courses.