⑩ Digital Processing class
Rounding: 1, rounding, format math.round (floating point)
2, remove the limit value, format math.floor (floating point)
3, take the upper value, format math.ceil (floating point)
Generates a random number 1,math.random () static method. Decimal between 0 and 1
2,random class instantiation of random random x =new random ()
Random x=new random (randomly seeded)
Generate random number general form int R (note r is name) = X.nextint ();
Nextint (maximum) generates a random number between 0 and the maximum value
The smaller the range, the easier it is to repeat.
Wrapper class double double the object name =new double ("string");
Object name. Doublevalue () to basic data type
The integer integer object name =new integer (12345);
int Iii=it.intvalue ();
The Boolean Boolean object name =new Boolean ("string") in two cases
One, the string is case-insensitive true to true two, and the other is False
1 DoubleD1 =123.1;2 3Double dd=NewDouble ("123.45");//converted from a string to a double4 DoubleDv=dd.doublevalue ();//turn from wrapper class to basic data type5System.out.println ("double=" +dd+ "double=" +DV);6 7Double df=NewDouble (1234.67);8String ds=df.tostring ();//wrapping class into a string9 System.out.println (DS);Ten OneFloat f=NewFloat ("123.45"); A intg=F.intvalue (); -SYSTEM.OUT.PRINTLN ("int value" +g); - theLong l=NewLong (123); - floatsss=L.floatvalue (); -SYSTEM.OUT.PRINTLN ("Output" +SSS); - +Integer it=NewInteger (12345); - intIii=it.intvalue ();//packing class for int + intIi=integer.valueof ("1234"). Intvalue (); ASYSTEM.OUT.PRINTLN ("Output" +III); at //Boolean type -Boolean b=NewBoolean ("True"); - Booleany=B.booleanvalue (); -SYSTEM.OUT.PRINTLN ("Output" +y);
View Code
2016/1/14 Digital class Processing packaging class