| | |
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: 8
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
Views: 1854 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Java
add android applet application arguments array arraylist arrays c# chat class classes client code compile component constructor convert coordinates data database db desktop eclipse error event exception fast file forloop fractal givemetehcodez graphics gridlayout gui helpwithhomework homeworkassignment html ide image images inheritance input interface j2me java jframe jpanel jtextarea jtextfield key lazy linked linked-list list loop looping method methods mobile netbeans newbie node number object objects oracle output page parameter pattern pixel problem programming read recursion remove robot scanner screen search server service set size sms socket software source sql string swing system text text-file threads time timer tree user





