aspose file tools*
The moose likes Beginning Java and the fly likes class assignment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class assignment" Watch "class assignment" New topic
Author

class assignment

Nelson Nadal
Ranch Hand

Joined: Jun 06, 2002
Posts: 170
Pls help me to find in Sun Tutorial the explanation about like the case of class assignment such as the ff:
Employee e = new Manager();
given that class Manager is a subclass of Employee class.
Employee has class variable a=5,b=10 with method incr() and decr().
Manager has class variable a=10,b=20. and add'l method of maint().
... or what really happened here?

Correct me if I'm wrong:
I know that e object has a type of Employee...
object e can't access maint() of Manager
object e has a variable a=5 ang b=10
is this what happened? what else? what do you call these concept?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
inheritance
polymorphism
http://java.sun.com/docs/books/tutorial/java/javaOO/subclasses.html
[ August 09, 2002: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
...and you might want to take a look at The "How my Dog learned Polymorphism" Story of The JavaRanch Campfire Stories.
Good Luck.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class assignment