I have created a package with the first line "package bookpack;" under which I have created a public class Book with three protected member: title, author and pubDate. The class has been compiled with "javac -d c:\ Book.java". After that compilation, I have verified that under c:\, bookpack directory has been created, and also Book.class file exists.
I have tried to create another package "package bookpackB;" under which I have attempted to create a subclass of "Book", writing "extends bookpack.Book". In the subclass I have tried to access the protected member of "Book" class. However, I am unable to compile that subclass.Errors appear that "unable to resolve symbol super, variables of "Book" class etc.
However, if I remove all package statements from both the superclass and subclass, all classes are compiled perfectly. I feel problem lies with the package creation.
Could some of you please help me in this regard?
Thanks in advance!