Confusion with constructors

Reply

Join Date: Apr 2005
Posts: 9
Reputation: jimbob8472 is an unknown quantity at this point 
Solved Threads: 0
jimbob8472 jimbob8472 is offline Offline
Newbie Poster

Confusion with constructors

 
0
  #1
Apr 6th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 9
Reputation: jimbob8472 is an unknown quantity at this point 
Solved Threads: 0
jimbob8472 jimbob8472 is offline Offline
Newbie Poster

Re: Confusion with constructors

 
0
  #2
Apr 6th, 2005
Or do they take the place of the private GuestData guest and private HotelDate startDate attributes?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 9
Reputation: jimbob8472 is an unknown quantity at this point 
Solved Threads: 0
jimbob8472 jimbob8472 is offline Offline
Newbie Poster

Re: Confusion with constructors

 
0
  #3
Apr 6th, 2005
nevermind crazy old jimbob8472 i just misread the whole thing and sorted the problem on my own heh sorry for wasting your time
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 609
Reputation: freesoft_2000 is an unknown quantity at this point 
Solved Threads: 7
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: Confusion with constructors

 
0
  #4
Apr 6th, 2005
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
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC