Which of the following is the correct way to declare a variable in Java?

PYQ DSSSB 2025

Which of the following is the correct way to declare a variable in Java?

  1. A.

    let x = 10;

  2. B.

    x = 10;

  3. C.

    var x = 10;

  4. D.

    int x = 10;

Attempted by 1143 students.

Sign up free to check your answer

Sign up free

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…