f07507d49ef0001c1a08b4789b32a530
来自「JAVA编程制作的几个程序」· 代码 · 共 47 行
TXT
47 行
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 + =
减小字号Ctrl + -
显示快捷键?