| | |
Confusion with constructors
![]() |
•
•
Join Date: Apr 2005
Posts: 9
Reputation:
Solved Threads: 0
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?
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?
•
•
Join Date: Jun 2004
Posts: 609
Reputation:
Solved Threads: 7
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
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
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
![]() |
Similar Threads
Other Threads in the Java Forum
- Previous Thread: How do you center the text in a JTextField??
- Next Thread: Help with overriding methods
| Thread Tools | Search this Thread |
-xlint actionlistener android api applet application array automation bi binary blackberry block bluetooth character class client code compile compiler component consumer database desktop developmenthelp eclipse error fractal freeze ftp functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide image int j2me j2seprojects java javac javaee javaprojects jetbrains jni jpanel jtable julia learningresources lego linked linux mac main map method mobile myregfun netbeans nonstatic notdisplaying number online pearl printf problem program project qt researchinmotion rotatetext rsa scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows working xor





