Java : Use child's attribute in parent's constructor

后端 未结 0 1112
暗喜
暗喜 2020-12-29 18:20
class Parent ()
{
     private int a;
     private final int b = a + 1; // a is null at that point
}

class Child extends Parent
{
    public Child()
    {
       a          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题