covtest t = new subcovtest();
System.out.println(t.getObject().getX());
-Piyush Porwal (Junk box)
Suresh Rajadurai wrote:
if t.getObject() is returning "Object B", then t.getObject().x is supposed to return 6 and NOT 5.
If you don't design your own life plan, chances are you will fall into someone else's plan.
SCJP 1.5
Suresh Rajadurai wrote:
Since my original program (my originial posting in this thread (far above) ) gives the output as 5 , I assume the object returned by the statement t.getObject() is similar to the object created in line //declaration Q above? Am I right?
Suresh.
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|