Skip to content

Instantly share code, notes, and snippets.

@jbiason
Created June 7, 2018 18:53
Show Gist options
  • Save jbiason/64f2c489bcc259fa55be685f131b191a to your computer and use it in GitHub Desktop.
Save jbiason/64f2c489bcc259fa55be685f131b191a to your computer and use it in GitHub Desktop.
abstract class BaseClass {
public static String getVersion() {
return "Unknown";
}
public static String getGroup() {
return "Unknown";
}
public static String getIdentifier() {
return getGroup() + getVersion();
}
// instance stuff
}
class Class1 extends BaseClass {
public static String getVersion() {
return "1";
}
public static String getGroup() {
return "Magic";
}
// specialized Class1 stuff
}
class Class2 extends BaseClass {
public static String getVersion() {
return "2";
}
public static String getGroup() {
return "Magic";
}
// specialized stuff for Class2 now
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment