1 常见的修饰
类:public
public class HelloWorld {}
成员变量:private
private String name;
private int age;
构造方法:public
public Student() {}
public Student(String name,int age) {}
成员方法:public
public void show() {}
public void eat() {}
2 常见的组合:
类:
public class HelloWorld {}
public final class HelloWorld {}
public abstract class HelloWorld {}
成员变量:
private String name;
public final int X = 10;
public static int y = 20;
public static final int X = 30;
成员方法:
public void show(){}
public abstract void show();
public final void show(){}
public static void show() {}
public static final void show() {}
修饰符
最新推荐文章于 2024-07-10 00:15:00 发布