import java.io.IOException;
//Demo01类
public class Demo01 {
//main方法
public static void main(String[] args) {
}
/*
修饰符 返回值类型 方法名(...){
//方法体
return 返回值;
}
*/
//break:跳出swith,结束循环
//return:结束方法,返回一个结果
public String sayhello(){
return "hello,world";//返回字符串
}
public void print(){
return;//返回null
}
public int max(int a,int b){
return a>b ? a :b;//三元运算符
}
//数组下标越界:Arrayindexoutofbounds
public void readFile(String file) throws IOException{
}
}
浙公网安备 33010602011771号