• Advertisement
Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65749

Extend vs Implement

Sign in to follow this  

78 views

For my event system I have a base class that looks like this:

public class jtEvent {

private JavaTactics j;//HERE FOR REFERENCE
public int ID;//ID CONFIGURED BY THE TRACKER

public jtEvent(JavaTactics j, int id) {
this.j = j;
this.ID = id;
}

public void activate() {
j.log.add("Activated Event: "+this.ID);
}

}




And then when I want to create a new event I just extend it and overwrite the activate() method. However if I made this an abstract class I could just write this as an abstract class and implement it in each of the events that I want to use it on.

SO, what should I use? Extend the jtEvent class or make it an abstract class?
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement