I'm trying to write a program calculating the age from the given date of birth.
I am using a ready-made source fromJava 6 Codebook, page 162 (sorry, it's German, but the code is still Java ;)
Anyway, when I try to compile the program I get an error: cannot find symbol symbol: variable MoreDate location class Geburtstag
I don't think that they made a mistake in the book, so it must be me...
The code I use is:
The variable MoreDate is nowhere, apart from this one place...
What could I do to make this work?
I left the German names unchanged not to break anything - can change if this might help.
Thank you for any of your suggestions.
I haven't read the book what is happening is two things.
Or you are missing the import statement of the MoreDate class.
Or you haven't written it yet in the same package this example is (default package it seems because you did not specify the package statement).
Check in your book again to see if they wrote this class before this example.
Welcome to JavaRanch
You need a class called MoreDate, which has a static age() method. I see other people have already told you.
Joined: Jul 02, 2009
Thank you for the immediate replies. As the book is just a preview it seems that certain parts might be missing Just like the MoreDate class.
Pity, but I'll try to do it somehow different.
Thanks for now
Joined: Oct 13, 2005
Marek Kruze wrote:I am using a ready-made source fromJava 6 Codebook, page 162
Maybe if you buy the book and find page 165 or page 161 you will know where MoreDate is