------------------ class Test extends create{ public Test(int j){}/*if i comment this line it works perfectly why??*/ public Test(int j,int k){super(j,k); } } --------------------- When you declare public Test(int j){} Compiler calls a no arg default constructor (super()) implicitly. As you do not have a default no arg constructor in create class the compilation fails. You should explicitly create a no arg default constructor in create class or explicitly call super( j, k) in the first line of your code. public Test(int j){super(j,0);}/* Note that if you do not create your own customized construtor Java creates a default no arg constructor for you, but if you create one then the default no arg constructor is not created, so, create class do not have default no arg constructor.
Post by:autobot
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, that will fit in a stocking