Which of the following options declares an integer variable

Which of the following options declares an integer variable?

Integer age;

integer age;

int age;

age: int;

1)

Integer age;

2)

integer age;

3)

int age;

4)

age: int;

Solution

int age;

declares the integer variable.

the default value of this type of declaration will be 0.

Lets say we want to delare integer variable age with default value of 1 below statement will be used:

int age = 1;

Which of the following options declares an integer variable? Integer age; integer age; int age; age: int; 1) Integer age; 2) integer age; 3) int age; 4) age: in

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site