Created
January 12, 2018 20:49
-
-
Save BarisGece/9e3e4f358541320a478ca7fc7a84953e to your computer and use it in GitHub Desktop.
Java Abstract Class Sample for Medium Story
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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