1.变量
package demo01;
public class Java3\_var {
public static void main(String\[] args) {
String name;
name = "张三";
String username = "李四";
}
}
2.数据类型
public class DataType {
public static void main(String[] args) {
byte b = 10;
short s = 10;
int i = 10;
long l = 10;
float f= 1.0F;
double d = 1.0;
}
}
3.运算符

4.循环控制, 打印九层
package demo01;
public class P35Test {
public static void main(String[] args) {
int level = 5;
for (int i = 0; i < level; i++) {
for (int j = 0; j < level - i; j++) {
System.out.print(" ");
}
for (int j = 0; j < i * 2 +1 ; j++) {
System.out.print("*");
}
System.out.println(' ');
}
}
}