Results 1 to 5 of 5
  1. #1
    prendergast36 is offline Member
    Join Date
    Sep 2011
    Posts
    9
    Rep Power
    0

    Default Dont know what im doing wrong here

    gotta be something simple
    Dont know what im doing wrong here-simple.jpg

  2. #2
    prendergast36 is offline Member
    Join Date
    Sep 2011
    Posts
    9
    Rep Power
    0

    Default Re: Dont know what im doing wrong here

    public class Square
    {
    private int size;
    private int xPosition;
    private int yPosition;
    private String color;
    private boolean isVisible;


    /**
    * create a new square with arbitrary field values.
    */
    public Square (int theSize,int theXPosition, int theYPosition,
    String theColor , boolean theVisibility)
    {
    size= theSize;
    xPosition= theXPosition;
    yPosition= theYPosition;
    color= theColor;
    if (theVisibility)
    makeVisible();
    else
    makeInvisible();

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

    Default Re: Dont know what im doing wrong here

    Look at the top row; there's already a square1 variable defined there; in the last line you're trying to define a square1 variable again; just as the compiler was trying to tell you in the bottom line.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    prendergast36 is offline Member
    Join Date
    Sep 2011
    Posts
    9
    Rep Power
    0

    Default Re: Dont know what im doing wrong here

    So is it suppose to be
    square1= Square(200,50,55,"black", true);

    This is giving me an error as well

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

    Default Re: Dont know what im doing wrong here

    Quote Originally Posted by prendergast36 View Post
    So is it suppose to be
    square1= Square(200,50,55,"black", true);

    This is giving me an error as well
    Indeed, because it's not supposed to be as you assumed. Move the last line to the first position and remove the old first line.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Out of Bounds. I dont know Why :L
    By socboy6579 in forum New To Java
    Replies: 10
    Last Post: 01-13-2011, 01:02 AM
  2. I dont know what's wrong with line 36. please help
    By amrmb09 in forum Advanced Java
    Replies: 31
    Last Post: 11-21-2010, 11:18 AM
  3. Hello! and I need help. I dont know were to start
    By Fall0ut in forum New To Java
    Replies: 10
    Last Post: 05-19-2010, 07:26 PM
  4. Sometimes get the right results sometimes dont
    By Battlefeldt in forum New To Java
    Replies: 0
    Last Post: 12-18-2009, 02:03 AM
  5. Replies: 6
    Last Post: 09-14-2009, 11:46 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
  •