java,
分享于 点击 29193 次 点评:112
java,
public class InitialValues2 {
boolean bool = true;
char ch = 'x';
byte b = 47;
short s = 0xff;
int i = 999;
long lng = 1;
float f = 3.14f;
double d = 3.14159;
} ///:~
也可用同样的方法初始化非基本类型对象
class Depth {}
public class Measurement {
Depth d = new Depth();
// ...
} ///:~
相关文章
- 暂无相关文章
用户点评