Results 1 to 2 of 2
  1. #1
    digital bath is offline Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Smile problem with constructors

    I'm trying to make a class with two constructors. I just started and ran into this problem. Eclipse has an error on Account() and Account(bal). It says they are both methods. They should be constructors, right? :eek:


    public class Account {

    private float balance;

    public Account(){
    balance = 0;
    }

    public Account(bal){
    balance = bal;
    }

    }

  2. #2
    digital bath is offline Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

Similar Threads

  1. constructors?
    By shroomiin in forum New To Java
    Replies: 4
    Last Post: 10-13-2009, 03:14 PM
  2. Constructors
    By new2java2009 in forum New To Java
    Replies: 5
    Last Post: 08-18-2009, 07:46 AM
  3. Need some help with a task, constructors.
    By JKM in forum New To Java
    Replies: 1
    Last Post: 02-01-2009, 11:09 PM
  4. Help with constructors
    By Minime in forum New To Java
    Replies: 3
    Last Post: 04-09-2008, 08:59 AM
  5. constructors
    By khamuruddeen in forum New To Java
    Replies: 2
    Last Post: 12-01-2007, 04:15 PM

Posting Permissions

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