Results 1 to 5 of 5
  1. #1
    Stefano is offline Member
    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0

    Angry having trouble Initialising instance variables in the constructor

    asdasd
    Last edited by Stefano; 02-27-2013 at 09:44 PM.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,375
    Blog Entries
    7
    Rep Power
    20

    Default Re: having trouble Initialising instance variables in the constructor

    Check how you want to call your constructor (pay attention to the actual parameter list) and how your constructor is defined (look at the formal parameter list); they differ according to the compiler and the compiler is always right.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Stefano is offline Member
    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0

    Default Re: having trouble Initialising instance variables in the constructor

    Sorry, but i'm still pretty confused

    i'm guessing it has to be something to do with the PersonalCustomer Class constructor, should i add a super. before initialising the variables?

    Kind regards

    Stefano

  4. #4
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,417
    Rep Power
    5

    Default Re: having trouble Initialising instance variables in the constructor

    Appears like another thread editing problem.

    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

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

    Default Re: having trouble Initialising instance variables in the constructor

    Here's the content removed from the OP:
    Quote Originally Posted by Stefano View Post
    it's a simple program to add/remove different types of customers

    I know it's probably something simple, but has had me for a while now

    Keep getting the error, constructor Customer in class Customer cannot be applied to the given types; required; java.lang. String, Address, char found:no arguments reason: actual and formal argument lists differ in length

    i'm guessing it's something to do with the customer constructor but don't know

    [Java] public class Address { private String street,town; /** - Pastebin.com
    This was in the deleted post:
    Quote Originally Posted by Stefano View Post
    Sorry, but i'm still pretty confused

    i'm guessing it has to be something to do with the PersonalCustomer Class constructor, should i add a super. before initialising the variables?

    Kind regards

    Stefano
    Stefano was cautioned against removing content that has replies, in this thread: Text User Interface, can't get a method which adds a customer to work

    Member Stefano is banned for a month. Any future repeat of this behavior will lead to a permanent ban.

    db

    THREAD CLOSED
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Instance Variables
    By TriSBR in forum New To Java
    Replies: 2
    Last Post: 11-16-2011, 04:16 PM
  2. Instance variables
    By lala in forum New To Java
    Replies: 1
    Last Post: 01-26-2011, 04:38 PM
  3. Constructor and instance field
    By MIA6 in forum New To Java
    Replies: 7
    Last Post: 11-02-2009, 06:44 PM
  4. What is Instance, Empty Constructor ....
    By tking88 in forum New To Java
    Replies: 21
    Last Post: 10-26-2009, 02:38 PM
  5. What are Instance variables and static variables?
    By sandeshforu in forum New To Java
    Replies: 3
    Last Post: 09-09-2009, 05:48 PM

Tags for this Thread

Posting Permissions

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