Okay then. Thanks to everybody who has posted replies so far. I've had a look at a couple of other threads and I think that I'm finally getting somewhere.
I think that if, instead of line 11 in the code that I originally quoted, I replaced it with :-
Then the code would compile although I'm a bit hazy as to exactly why.
I'm getting very confused about the idea that the subclass can only access superclass variables in this example if they create and use that superclass member themselves.
My problem is exacerbated because I can't get the code to compile. I have separated the two files, saved them to my
Java directory on the hard drive and compiled superclassX.java. When I try to compile subclassY then the compiler complains that it can't find packageX in the import statement and that it can't find superclassX.
Any further help much appreciated.
Finding this bit dog-darn difficult and looking forward to a yee-ha moment soon ......
Simon