This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
So, I'm working with a Java book and I'm playing around trying to understand some basic java concepts and I write some do nothing code to teach myself about overriding methods and I'm getting an error I don't understand at all.
Now, I was planning on implementing the compoundIterate method on line marked twelve in the Account class and then overriding it in SavingsAccount method on line marked 8, so I can play around and learn but I'm already getting errors and not sure what they're about. I use Eclipse IDE. All errors mentioned hereafter are in class Savings account.
@Line 8: "Illegal modifier for parameter compoundIterate; only final is permitted"
If I replace "public" with "final" the error goes away. Why does it want me to make this method final?
@Line 8: under the comma between years and monthlyInvest parameters "syntax error on token "," ; expected"
@Line 8: under the closing parenthesis for the method signature "syntax error on token ")" ; expected"
replacing either of these "tokens" with a semicolon makes the error go away which doesn't make ANY sense to me at all
@Line 11: "Void methods cannot return a value"
the method signature clearly has a double return type. Why in the world does Eclipse think this method has a void return type?
I'm guessing I'm doing something basic wrong and Eclipse is giving me a bunch of errors that would go away if i changed it. Debugging features can tell you when something is wrong but often give misleading errors because they don't know what you're trying to do - but... I don't know what the deal is. A hint please? [ June 21, 2008: Message edited by: Tristan Rouse ]