Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

What happens?

Options
  • 10-05-2008 8:41pm
    #1
    Closed Accounts Posts: 75 ✭✭


    class Cut
    {

    private int u = 3;
    private double d = 4.5;

    Cut(int u0,double d0) {u= u0;d= d0;}

    Cut(double d0) {d= d0;}


    lets say then in the main body this is supplied

    p = new Cut(10,3.14);


    its on a past exam paper im doin
    any help would b great


Comments

  • Registered Users Posts: 26,579 ✭✭✭✭Creamy Goodness


    what do you think happens?

    show an attempt and we can tell you if you're right or wrong


  • Registered Users Posts: 1,322 ✭✭✭Mad_Max


    are you asked to state what condition the variables will be in at that point?

    As the post before says post your attempt and the full question with it and we can get a better idea.


  • Registered Users Posts: 2,567 ✭✭✭daveharnett


    Unless there's some trick to the question that i've missed....
    The command will create a new Cut object called p, in which u=10 and d = 13.4


  • Registered Users Posts: 1,922 ✭✭✭fergalr


    The command will create a new Cut object called p, in which u=10 and d = 13.4
    The above has a minor typo/mistake in it, in case the OP is looking at this and getting more confused.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I suppose to work it out OP you'll need to read up on Classes and Class contructors. You might also have a read of this with regards to problem solving.


  • Advertisement
  • Registered Users Posts: 3,620 ✭✭✭Grudaire


    It's too late for him now, I think that exams just gone:D


Advertisement