📄 f07507d49ef0001c1a08b4789b32a530
字号:
package com.javabook.ch03;
public class AccessControl {
/**
* @param args
*/
public int a;
private int b;
protected int c;
int d;
public void f1(){
System.out.println("公有方法");
}
private void f2(){
System.out.println("私有方法");
}
protected void f3(){
System.out.println("保护方法");
}
void f4(){
System.out.println("友好方法");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
AccessControl test = new AccessControl();
test.a=1;
System.out.print("公有属性a="+test.a);
test.b=2;
System.out.print("私有属性b="+test.b);
test.c=3;
System.out.print("保护属性c="+test.c);
test.d=1;
System.out.print("友好属性d="+test.d);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -