Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class assignment

 
Nelson Nadal
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
inheritance
polymorphism
http://java.sun.com/docs/books/tutorial/java/javaOO/subclasses.html
[ August 09, 2002: Message edited by: Marilyn de Queiroz ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic