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

Last Updated :
Discuss
Comments

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

int number = 10;

var number = 10;

Integer number = 10;

All of the above


Share your thoughts in the comments