Important Java Mcq 1

To declare a constant max_length as a member of the class, you write?

a. Final static float MAX_LENGTH = 99.98;

b. Final static MAX_LENGTH = 99.98;

c. Final double MAX_LENGTH = 99.98;

d. Final static double MAX_LENGTH = 99.98;

Answer:

d. Final static double MAX_LENGTH = 99.98;

Explanation:

MAX_LENGTH defines the maximum length of data value. While declaring MAX_LENGTH as a member of the class, you need to use the final keyword (By using final keyword the value can’t be changed), static keyword, and double because the value is a floating point number.

Related MCQs
Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?