parent children

class parent{
                   protected static int count=0;
            public parent()          {   count++;    }
}
public class child extends parent{ public child() { count+=5; } public static void main(String args[]){ child x=new child(); System.out.println("count="+x.count); } }

原文地址:https://www.cnblogs.com/fantasy12436109/p/3971091.html