Skip to content

Instantly share code, notes, and snippets.

@BarisGece
Created January 12, 2018 20:49
Show Gist options
  • Save BarisGece/9e3e4f358541320a478ca7fc7a84953e to your computer and use it in GitHub Desktop.
Save BarisGece/9e3e4f358541320a478ca7fc7a84953e to your computer and use it in GitHub Desktop.
Java Abstract Class Sample for Medium Story
public abstract class MyAbstractClass {
String qAbstractClassVar;
public void xVoidMethod() { }
public String yStringMethod() {
String y = "String Value";
return y;
}
public abstract int zIntAbstractMethod();
public abstract String tStringAbstractMethod();
public abstract void kVoidAbstractMethod();
}
public class MyClass extends MyAbstractClass {
@Override
public int zIntAbstractMethod() {
return 0;
}
@Override
public String tStringAbstractMethod() {
return null;
}
@Override
public void kVoidAbstractMethod() { }
public void a() {
xVoidMethod();
}
@Override
public void xVoidMethod() {
super.xVoidMethod();
}
public String b() {
return yStringMethod();
}
String b = qAbstractClassVar;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment