Results 1 to 2 of 2
  1. #1
    cagipple is offline Member
    Join Date
    Mar 2011
    Posts
    11
    Rep Power
    0

    Default Trouble understanding objects

    Given the statements:

    Clock firstClock = new Clock(2, 6, 35);
    Clock secondClock = new Clock(6, 23, 17);

    firstClock = secondClock;

    What is the output of the following statements?

    firstClock.print();
    System.out.println();
    secondClock.print();
    System.out.println();

    Can anyone help me out with this?

    Thanks in advance

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Trouble understanding objects

    Quote Originally Posted by cagipple View Post
    Given the statements:

    Clock firstClock = new Clock(2, 6, 35);
    Clock secondClock = new Clock(6, 23, 17);

    firstClock = secondClock;

    What is the output of the following statements?

    firstClock.print();
    System.out.println();
    secondClock.print();
    System.out.println();

    Can anyone help me out with this?

    Thanks in advance
    No we can't. We don't have a clue as to what is in the Clock class so can't even try to blindly guess what the output is. Why not try the code and find out for yourself?

Similar Threads

  1. Trouble understanding CardPanel
    By ThrashingBoy in forum New To Java
    Replies: 9
    Last Post: 05-23-2011, 01:52 PM
  2. trouble understanding code help
    By yasmin k in forum New To Java
    Replies: 4
    Last Post: 11-16-2009, 09:46 PM
  3. Having trouble understanding Class Graphic
    By Bernard Robitaille in forum JCreator
    Replies: 1
    Last Post: 04-18-2009, 02:55 AM
  4. I have trouble understanding this program!
    By PureAwesomeness in forum New To Java
    Replies: 1
    Last Post: 03-16-2009, 05:34 AM
  5. [SOLVED] Trouble understanding or expressions
    By hungdukie in forum New To Java
    Replies: 1
    Last Post: 11-23-2008, 01:24 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
  •