Folks, i've typed in a program used to illustrate some concepts used in inheritance, from a book. The thing is, there are 2 errors , and I think they are related to the fact that i'm referring to two non-static variables, within a static method:-
public static void main (String args[])
{
BoxWeight mybox1 = new BoxWeight (10,20,15,34.3);
BoxWeight mybox2 = new BoxWeight (2,3,4,0.076);
The full code listing is shown below. What grates me is that this code has been printed in text book, and therefore has errors in it (I think!).
Any help in solving this problem would be greatly appreciated. Cheers in advance.
code
public static void main (String args[])
{
BoxWeight mybox1 = new BoxWeight (10,20,15,34.3);
BoxWeight mybox2 = new BoxWeight (2,3,4,0.076);
The full code listing is shown below. What grates me is that this code has been printed in text book, and therefore has errors in it (I think!).
Any help in solving this problem would be greatly appreciated. Cheers in advance.
code