943,918 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2003
  • Java RSS
Apr 6th, 2005
0

Confusion with constructors

Expand Post »
i have an assignment to write a hotel booking system in java

i have to write this class

"The Booking class brings together all the details for a booking into a single object. When creating a Booking object, it is vital that:

* The room availability has previously been checked.
* A HotelDate object for the start date of the booking has been created.
* A GuestData object containing the appropriate names has been created.

You are required to write the Booking class from scratch. It has the following attributes:

* private HotelDate startDate
The first date of the booking
* private int numberOfDays
The length of the booking period in days. Eg 7 for a booking of 1 week.
* private GuestData guests
The details of the guest(s) making the booking
* private Room room
The room to be occupied.

but i dont understand where i create the HotelData and guestData objects
is it in the contructor or before?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jimbob8472 is offline Offline
9 posts
since Apr 2005
Apr 6th, 2005
0

Re: Confusion with constructors

Or do they take the place of the private GuestData guest and private HotelDate startDate attributes?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jimbob8472 is offline Offline
9 posts
since Apr 2005
Apr 6th, 2005
0

Re: Confusion with constructors

nevermind crazy old jimbob8472 i just misread the whole thing and sorted the problem on my own heh sorry for wasting your time
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jimbob8472 is offline Offline
9 posts
since Apr 2005
Apr 6th, 2005
0

Re: Confusion with constructors

Hi everyone,

In case you get confuse again here is a link for a short tutorial on java constructors

http://leepoint.net/notes-java/20lan...nstructor.html

Yours Sincerely

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: how to do a basic system pause
Next Thread in Java Forum Timeline: Help with overriding methods





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC