This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to construct Class?

 
Anu satya
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Every body,

I am new to java world. I have a very basic question:

If I need to develop a class where seats has to be booked for flights.(Business and Economic.)Economic category can have only window and airsel seats. Business category can have Window, airsel and middle seat. How to Construct the class for this situation?

Thanks for your time and reply.
Please help!

Regadrs.
[ March 15, 2006: Message edited by: Jim Yingst ]
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That seems to be an assignment of some kind that you should be working on. We're not going to do it for you. If you want help, show us what you have done so far, and where you're stuck, and then we'll help you get going again.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The place to start with any class definition is usually the interface: What are the public methods? Once you have these, build the rest of the class to support implementation of these methods.

So, as Ulf said, what do you have so far? And what specific problems are you having?
 
Tony pony
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can help if u post code
 
Raj Maheshwari
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can guide you if you post what your current solution is so far and how you're approaching the problem. Just a straight forward HOW TO do the thing would give the answer away, wouldn't it? And it would completely beat the purpose of your assignment.

Start thinking about how it would be organized in the real world and encapsulate it in to classes. Remember, each class must serve a purpose to solve a larger problem and provide other classes with functionality.

hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic