• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java override

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?










 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic