Results 1 to 5 of 5
- 04-22-2010, 04:58 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 78
- Rep Power
- 0
Im a little confused on what classes are!
I just read a chapter in my java book about classes. It gives an example of a problem and says you will need 3 classes, a customer class, a cars class, and a service quote class. each get different things and do different things. my question is, are all these classes in one program, or are they separate programs that interact with each other somehow.
because earlier in the book i think i saw a class in one program, but then main was interacting with it from another program or something.
also whats the difference of constructors and methods? do constructors only initialize things?
- 04-22-2010, 06:12 AM #2
Senior Member
- Join Date
- Feb 2010
- Location
- Ljubljana, Slovenia
- Posts
- 470
- Rep Power
- 4
These are very broad questions that we can't really answer in a few short posts. In the most basic term, a class is a definition of an object, and in OOP you don't really think in terms of "this is part of program 1, this is part of program 2". Instead, you think of classes as modules, what you write for one application can be usefull for others as well.
- 04-22-2010, 06:54 AM #3
Member
- Join Date
- Mar 2010
- Posts
- 16
- Rep Power
- 0
no.. there class not in separated program. but every class will interact with OOP concept like composition, aggregation , assosiation etc.
Tugas Besar Information Retrieval IT Telkom 0910-2
- 04-22-2010, 07:44 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Suppose you find a book in the library "Build Your Own ICBM"; you read and follow all the instructions in the book and build your own ICBM in your back yard. That book is the class for ICBM objects and you are the constructor.
Each class definition is in its own book (file) and all books are assembled in one library (the final program).
kind regards,
Jos
- 04-22-2010, 08:58 AM #5
Hallo Meta
because the concepts behind classes arent' trivial it's normal to be confused. i hope with this link http://java.sun.com/docs/books/tutorial/java/concepts/ you find the informations you are looking for.Last edited by j2me64; 04-22-2010 at 09:01 AM.
Similar Threads
-
Got confused with extending classes.
By nethz13 in forum New To JavaReplies: 7Last Post: 04-19-2010, 12:19 AM -
Help i am so confused..:(
By angeltiner in forum AWT / SwingReplies: 6Last Post: 04-11-2010, 01:43 AM -
confused
By updev in forum AWT / SwingReplies: 6Last Post: 11-14-2008, 03:33 PM -
a lot confused
By vineethraj in forum New To JavaReplies: 4Last Post: 01-18-2008, 12:36 AM -
what does it mean:confused:
By sivasayanth in forum New To JavaReplies: 2Last Post: 01-12-2008, 04:52 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks