So I use Eclipse IDE. I am just practising with Java, so I'm only doing silly practise projects with stuff like Fruit classes and what not. To try out class extensions, I have one file, Fruit.java, and another, FruitRunner.java (to hold main, because putting main inside of an inner class causes Eclipse to malfunction).
Here is the content of Fruit.java:
And here is my runner:
Some things to note:
>The problem is that this will print "This is a null null" instead of a "This is a Green Granny Smith".
>In Fruit.java, Eclipse says that apple1.color and apple1.type are never used, which of course makes sense because it manifests as null in the runner.
>The only reason I have FruitRunner.java is because when I tried declaring main inside of that inner class, Eclipse said it failed to find main() .