欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

java,

来源: javaer 分享于  点击 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();
  // ...
} ///:~

相关文章

    暂无相关文章
相关栏目:

用户点评