Unresolved compilation problem - Eclipse
I have a Driver class, a money class, a bill class, and a date class.
My driver code that I'm having issues with is:
Money amount = new Money(20);
Date dueDate = new Date(4, 5, 2011);
Date paidDate = new Date(4, 4, 2011);
Bill bill1 = new Bill(amount, dueDate , "phone company");
In my date class, it is returned as a string, so dueDate is technically a string. However, when I try to run this code, i get compilation error. In Bill class, the line of code that it's having an issue with is
Bill (Money amount, String dDate, String Orig){
Amount = amount;
dueDate = dDate;
Originator = Orig ;
paidDate = null;
status = false;
I think that Eclipse is having an issue with dueDate being a string..
I don't know if this makes sense. Any thoughts on how to fix this?
Re: Unresolved compilation problem - Eclipse
http://www.java-forums.org/forum-gui...w-members.html
BB Code List - Java Programming Forum
Quote:
Originally Posted by
ohcrapitsDevin
However, when I try to run this code, i get compilation error.
You don't get compiler errors when trying to run code. You get them when you try to compile code.
Do we play 20 questions trying to guess the error(s) or did you just forget to post the error messages?
db
Re: Unresolved compilation problem - Eclipse
Quote:
Originally Posted by
ohcrapitsDevin
In my date class, it is returned as a string, so dueDate is technically a string.
No. Technically dueDate is a Date because that is what type you declared it as. Just because you may have a method that returns a String representation of the Date does not mean that the compiler can read your mind and automagically convert the Date to a String for you.