package com.newway.test;
public class Test {
public static void main(String[] args) {
A.a++;
A.b++;
A.c++;
A.d++;
}
}
class A {
static private int a = 1;
static int b = 2;
static protected int c = 3;
static public int d = 4;
protected void funA() {
}
}
用了你的例子,首先你之所以报错,是因为在B中你对属性的操作没有放在方法之中。