• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java override  RSS feed

 
Jijgee Jamsran
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have 3 classes:Super, Sub, and Derived classes which are:


the thing is that I want to override test method of Sub class in the Derived class. I think association classes of super class also derive. So can i override the test method. How do i describe these class and their method by UML?










 
D. Ogranos
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch!

You can't override the test() method in the Super class, since the method isn't a member of that class. However, you can of course use subclasses of Sub in your Super class, which use an overridden test() method. Like



Hope this helps.

Btw. please use code tags too, it makes reading your code samples easier
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!