Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Default 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.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Unresolved compilation problem - Eclipse

    Guide For New Members
    BB Code List - Java Programming Forum

    Quote Originally Posted by ohcrapitsDevin View Post
    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
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Junky's Avatar
    Junky is online now Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,761
    Rep Power
    7

    Default Re: Unresolved compilation problem - Eclipse

    Quote Originally Posted by ohcrapitsDevin View Post
    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.

Similar Threads

  1. Replies: 1
    Last Post: 11-06-2011, 04:41 PM
  2. Replies: 2
    Last Post: 11-06-2011, 04:40 PM
  3. Unresolved compilation problem
    By ls7897 in forum New To Java
    Replies: 9
    Last Post: 03-09-2011, 01:42 AM
  4. Unresolved compilation problem
    By mew in forum New To Java
    Replies: 2
    Last Post: 12-30-2007, 07:17 PM
  5. Unresolved compilation problem
    By mew in forum New To Java
    Replies: 3
    Last Post: 12-11-2007, 11:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •