Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is the correct statement to define an integer variable I with an initialization value of 12 in java?
What is the correct statement to define an integer variable I with an initialization value of 12 in java?
int I = 12;

Decomposition:

Int stands for a type, and there are many basic data types in Java. They also have encapsulation classes, such as int and Integer.

When we initialize an integer, we use its base class int directly

I is the handle in the process of initializing this instance, and it is also the most important idea of Java. Object-oriented, then I am an object.

The equal sign is followed by the value.

Ask me online if you don't understand.

Similar to String str = "12"; This is a string!