thanks for the reply... i wanted to ask one more thing... in the following code... when the minor class's constructor calls its base class constructor with arguments.. ie super(y) at line 1.. is it that 'y +=3' also executes or before it is executed the base class constructor is called.??? then when is it executed.... same is the case with this()..
[ June 08, 2008: Message edited by: sweety singh ]
the answer of this question is Compilation fails... and the explanation says "Uber's constructor's call to this is looking for a no- argument constructor that doesn't exist"... i have not understood this... i have got confused please explain me this...
this question is from K&B master exam...
the answer of this code is a compilation error at #1.. in the explanation of this program says "only instance methods can be overridden and calls to super only apply to overridden methods" i have not understood this...
please expalin me what is menas... and what is System.out.print() statement doing its only for input at the command prompt i guess???
the book says that the question mark works when declaring a reference for a varible its does not work for generics class and method declaration.. i did not understand this...
hey thanks for that reply... but i want to ask you one thing... in the following code..
Code:
public void addAnimal(List<? extends Animal> animals)
{ animals.add(new Dog()); //1 }
in line 1.. the book says "No! can't add if we use <? extends Animal>" why is it so... [ May 25, 2008: Message edited by: sweety singh ] [ May 25, 2008: Message edited by: sweety singh ]
hi all... can somebody tell me the difference between <? extends Animal> and <? super Animal> with example.... i am slightly confused... thanks in advance...