public class Test {
public static void Main (string[] args) {
Output a variable of a long integer 123456789012345
Long h = 123456789012345l;
System.out.println (h);
Outputs a single-precision decimal constant of 2.4
float H1 = 2.4f;
SYSTEM.OUT.PRINTLN (H1);
Output a variable of type Boolean
Boolean H2 = true;
System.out.println (H2);
H2 = false;
System.out.println (H2);
byte h3 = 3;
H3 = (Byte) (h3 + 200);
System.out.println (H3);
Addition calculation of output character type
System.out.println ((char) (' a ' + 1));
System.out.println ((char) (' I ' + 1));
Demonstrating the overflow effect of a variable
int h4 = integer. Max_value + 1;
System.out.println (H4);
Assigns a value to X, calculates the x=x/1000*1000 and outputs the result.
/*
* Import Java.util.Scanner;
public class math{
public static void Main (string[] args)
{
Scanner input=new Scanner (system.in);
Double X;
System.out.println ("Enter the X");
x = double.valueof (input.nextdouble ());
x = x/1000 * 1000;
SYSTEM.OUT.PRINTLN ("The calculation result is" + x);
}
* */
}
}
Java 9.18