| | |
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 |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card character class client code collision component crashcourse css csv database eclipse ee error fractal free ftp game gis givemetehcodez graphics gui html ide image integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linux list loan machine map method methods migrate mobile netbeans objects oriented output panel phone physics problem program programming project projects radio recursion replaydirector reporting researchinmotion rotatetext scanner se server service set sms software sort sql string swing test textfield threads tree trolltech ubuntu utility windows





