permaculture playing cards*
The moose likes Beginning Java and the fly likes A Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A "Class" problem, someone help me..." Watch "A "Class" problem, someone help me..." New topic
Author

A "Class" problem, someone help me...

Chuan Chung Tsao
Greenhorn

Joined: Sep 27, 2003
Posts: 2
This is my first time I contact JAVA, and now I learn about the class. My teacher told me that when we construct a object, it should follow six steps.
Ex:
A a = new A();
1 2 6 34 5
But I still can't remember what the meaning of six steps. If someone can tell me how to memorize them. Thanks.
Igor Ko
Ranch Hand

Joined: Jun 24, 2002
Posts: 90
I think, that you probably expain the home work task - write
class that should support six steps....
[ November 30, 2003: Message edited by: Igor Ko ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Andy --
Welcome to JavaRanch!
We don't have too many rules 'round these parts, but we do have our naming policy, which requires you to have a non-fictitious-sounding display name -- you might try using your own first and last names, as many others here do. Please head over here and fix yours, pronto. Thanks pardner -- hope to see you around the Ranch!
Now, as to your question: as someone who has taught Java programming for many years now, I can tell you with certainty that there are no universally recognized "six steps that constructing an object should follow." Maybe this was a particular teaching aid your professor used, in which case you might ask him or her, or ask a teaching assistant. It's their job to tell you, after all -- you're paying for an education!
I'm sorry that we can't offer you any more regarding this issue, but please don't let that keep you from coming back when you have more questions. Usually we're pretty darn helpful!
[ November 30, 2003: Message edited by: Ernest Friedman-Hill ]

[Jess in Action][AskingGoodQuestions]
Joe Pluta
Ranch Hand

Joined: Jun 23, 2003
Posts: 1376
Ernest, my guess is that the six steps refer to the breaking down of the actual statement.
1 = identifies the class of the variable holding the object
2 = identifies the name of the variable holding the object
3 = "new" creates a new object
4 = identifies the class of the object being created
5 = identifies the parameters being passed to the constructor
6 = assigns the newly created object to the variable

Joe
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Joe --
Makes sense!
Igor Ko
Ranch Hand

Joined: Jun 24, 2002
Posts: 90
If so I can add:
7. add access rule (default, private, protected, public)
8. set default value of variables.
9. think about thread synchronization - add "synchronized" to
some functions.
10. Think about can/should be class extends or no - add key word
"abstract", or "final"
11. . . . . . . .
There a lot of steps can be here.
[ December 01, 2003: Message edited by: Igor Ko ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A "Class" problem, someone help me...