Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Java problem. "int r= new integer (tf 1.getText ()). int value();" Please tell me this sentence in detail.
Java problem. "int r= new integer (tf 1.getText ()). int value();" Please tell me this sentence in detail.
Internationalorganizations (same as international organizations)

Is a basic type in java, and Integer is a class. integer

Class wraps primitive types in an object.

Internationalorganizations (same as international organizations)

The value of is equivalent to adding some methods to the int type. IntValue () is a member method of the Integer class, which returns a value of type int. Since it is a class, you can use new.

Create a new object. And int

r=

new

Integer (tf 1.getText ()). int value(); "means to get the text from tf 1, package it into an Integer object, and then assign the value of this object to R as an int type.