java基础
//Demo01是类
public class Demo01 {
//main 是方法
//面对对象本质: 一类的方式组织代码,一对象的方式封装代码 三的特性封装,继承,多态
public static void main(String[] args) {
}
/* 修饰符 返回值的类型 方法名字(....){
//方法体
return 返回的值;
} */
//return 结束方法,返回一个值 brake 跳出switch
public String hello(){
return "hello world";
}
public int max (int a,int b){
return a<b ? a : b;//三元运算符 如果a小于b那么就是a否则是b
}
}