1.new-package-naming method com begins. The middle name. The class to be created in the background
2. Create Class-new-class Select the Main method
Code samples compile and save a bit to output information, has not been saved will not output
Package com.chongrui.test;
public class Test {
public static void Main (string[] args) {
BYTE mybyte=124;
Short myshort= 32564;
int myint = 45784612;
Long MyLong = 4678951L;
Long result =mybyte+myshort+myint+mylong;
System.out.println ("Four added results +:" +result);
}
Package com.chongrui.test;
public class Sumnuber {
public static void Main (string[] args) {
TODO auto-generated Method Stub
float f1=12.23f;
Double d1= 4562.12d;
Double d2= 4567.1564;
Double result=f1+d1+d2;
SYSTEM.OUT.PRINTLN ("The result of adding three floating-point types is:" +result);
}
}
Output results three floating-point additions result in: 9141.506399542235
Package com.chongrui.test;
public class Export {
public static void Main (string[] args) {
TODO auto-generated Method Stub
int i = ' d ';
char C = 97;
System.out.println ("The Unicode encoding of the character D is" +i);
System.out.println ("the character represented by the Unicode code 97 is" +c);
}
}
Package com.chongrui.test;
public class Export {
public static void Main (string[] args) {
TODO auto-generated Method Stub
int i = ' d ';
char C = 97;
System.out.println ("The Unicode encoding of the character D is" +i);
System.out.println ("the character represented by the Unicode code 97 is" +c);
}
}
The Unicode encoding for character D is 100
The character represented by the Unicode code 97 is a
1.1-java ways to create packages and classes