public class Main {
public static void main(String[] args) {
System.out.println("hello, world!");
}
}
output
Hello World!
Output by System.out.println Enclose the character string in "" Add; at the end
public class Main {
public static void main(String[] args) {
System.out.println("hello, world!");
System.out.println("31+Do 31 calculations");
System.out.println(31+31);
}
}
output
hello, world!
31+Do 31 calculations
62
Do not enclose in "for formulas"
public class Main {
public static void main(String[] args) {
int x;
x = 6;
System.out.println(x * x * 3.14);
}
}
output
113.04
int is used when defining numbers
Recommended Posts