Why can a class only have one parent but you can chain parents together effectivly doing the same thing like this? Or am I thinking this is doing something that it isn't?
public class myFirstClass
{
public int someFirstInt;
public myFistClass(int fi)
{
someFirstInt = fi;
}
}
public class mySecondClass extends myFirstClass
{
public int someSecondInt;
public mySecondClass(int si, int fi)
{
super(fi);
someSecondInt = si;
}
}
public class myThirdClass extends mySecondClass
{
public int someThirdInt;
public myThirdClass(int ti, int si, int fi)
{
super(si, fi);
someThirdInt = ti;
}
}
public class myForthClass extends myThirdClass
{
public int someForthInt;
public myForthClass(int foi, int ti, int si, int fi)
{
super(ti, si, fi);
someForthInt = foi;
}
}
myForthClass ChainParent = new myForthClass(1, 1, 1, 1);
does myForthClass effectivly have access to everything in myThirdClass, mySecondClass, and myFirstClass?
Edited by 0Circle0, 31 December 2012 - 05:08 AM.







