Results 1 to 3 of 3
- 10-21-2012, 09:43 PM #1
Member
- Join Date
- Oct 2012
- Posts
- 1
- Rep Power
- 0
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?Last edited by ohcrapitsDevin; 10-21-2012 at 09:45 PM. Reason: Wasn't done.
- 10-22-2012, 04:15 AM #2
Re: Unresolved compilation problem - Eclipse
Guide For New Members
BB Code List - Java Programming Forum
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?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 10-22-2012, 04:57 AM #3
Re: Unresolved compilation problem - Eclipse
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.
Similar Threads
-
Exception in thread "main" java.lang.Error: Unresolved compilation problem
By shaminder in forum New To JavaReplies: 1Last Post: 11-06-2011, 04:41 PM -
Exception in thread "main" java.lang.Error: Unresolved compilation problem
By jcen in forum New To JavaReplies: 2Last Post: 11-06-2011, 04:40 PM -
Unresolved compilation problem
By ls7897 in forum New To JavaReplies: 9Last Post: 03-09-2011, 01:42 AM -
Unresolved compilation problem
By mew in forum New To JavaReplies: 2Last Post: 12-30-2007, 07:17 PM -
Unresolved compilation problem
By mew in forum New To JavaReplies: 3Last Post: 12-11-2007, 11:49 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks