Menu

[r4276]: / trunk / dynamicjava / testFiles / jlbench / Autoboxing.jlbench  Maximize  Restore  History

Download this file

82 lines (65 with data), 1.2 kB

/** Unbox a Boolean in an assignment */
test {
  boolean x = new Boolean(true);
}

/** Unbox a Character in an assignment */
test {
  char x = new Character('a');
}

/** Unbox a Byte in an assignment */
test {
  byte x = new Byte((byte) 23);
}

/** Unbox a Short in an assignment */
test {
  short x = new Short((short) -12);
}

/** Unbox an Integer in an assignment */
test {
  int x = new Integer(23);
}

/** Unbox a Long in an assignment */
test {
  long x = new Long(23l);
}

/** Unbox a Float in an assignment */
test {
  float x = new Float(-15.0f);
}

/** Unbox a Double in an assignment */
test {
  double x = new Double(23.0);
}

/** Box a boolean in an assignment */
test {
  Boolean x = true;
}

/** Box a char in an assignment */
test {
  Character x = 'a';
}

/** Box a byte in an assignment */
test {
  Byte x = (byte) 23;
}

/** Box a bhort in an assignment */
test {
  Short x = (short) -12;
}

/** Box an int in an assignment */
test {
  Integer x = 23;
}

/** Box a long in an assignment */
test {
  Long x = 23l;
}

/** Box a float in an assignment */
test {
  Float x = -15.0f;
}

/** Box a double in an assignment */
test {
  Double x = 23.0;
}

/** TODO: Boxing/unboxing in method calls */
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.