以下代码输出为:(numberOfInstances)
class Parent
{
public int numberOfInstances;
protected Parent(int numberOfInstance)
{
this.numberOfInstances=numberOfInstance;
}
}public class Example extends Parent
{
private Example(int numberOfInstances)
{
super(numberOfInstances);
}
public static void main(String...strings)
{
Example ext=new Example(420);
System.out.println(ext.numberOfInstances);
}
}