第一个程序hello world
数据类型:
布尔、byte、short、int、long、flot、double
定义变量
定义字符串:
定义数组
运算符:算数运算符、关系运算符、逻辑运算符、赋值运算符
三元运算符:
if的三种格式
public class Demo{
public static void main(String[] args){
//if的第一种格式:if...
int age=18
if(age>=18){
System.out.print("你成年了")
}
//if的第二种格式:if...else...
if(age>=18){
System.out.print("你成年了")
}else{
System.out.print("你没有成年")
}
//if的第三种格式:if...else...
if(age>=18){
System.out.print("你成年了")
}else if(age>8){
System.out.print("你是青少年")
}else{
System.out.print("你还是儿童")
}
}
}
for循环
break和continue
方法定义和方法重载
方法重载
面向对象
类和对象的定义
创建对象调用属性和方法
构造方法
成员变量和局部变量
this关键字、static关键字
访问修饰符范围