I am reading Kathy Sierra and I wish to give SCJP exam.
Today when I tried to test the concept of protected V/S Default access modifier I got struck with a problem.
Your code is fine. The compilation error seems to suggest that either the file protTestChild.java is deleted/renamed before running javac or else it is hidden/not readable.
Have you checked the location and "file attributes" of the file?
HTH,
Nidhi
"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Suvojit Chakraborty
Ranch Hand
Joined: Nov 10, 2009
Posts: 59
posted
0
Neha Daga wrote:read this. may be this can help you.
Thanks a lot for your quick reply.
I got the solution from some other forum. I needed to execute the command as C:\Program Files\Java\jdk1.5.0_06\bin>javac xyz/ProtTestChild.java
But I thank you Neha, the link you gave proved to be something which I have been searching for a long time.I was in a habit of saving my programs in bin directory although I knew its not a good practice but since I was not clear with the classpaths and environment variable so I had to do it against my will.
It would be a great help if you can tell me more about classpaths and environment variable or may be give some other usefull links to study.
Word of advice: Don't keep any of your source and class files inside of the JDK's bin directory (or anywhere else in the JDK directory, for that matter). It's bound to create problems.
Ulf Dittmer wrote:Word of advice: Don't keep any of your source and class files inside of the JDK's bin directory (or anywhere else in the JDK directory, for that matter). It's bound to create problems.
yup... correct!
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
About the names of your classes: Using the names "Parent" and "Child" for superclasses and subclasses is really wrong; inheritance in OO programming is not the same as biological inheritance. Confusing the OO programming concept of inheritance with the biological meaning of the word will make it harder for you to understand what "inheritance" means with regard to programming.