Skip to content

Instantly share code, notes, and snippets.

@dnivra26
Created June 5, 2019 09:43
Show Gist options
  • Save dnivra26/fb72f75ef2e7e93d7455cae8d606bd43 to your computer and use it in GitHub Desktop.
Save dnivra26/fb72f75ef2e7e93d7455cae8d606bd43 to your computer and use it in GitHub Desktop.
class List {
public void add(){
}
public int get() {
}
}
class Stack extends List{
@Override
public void add() {
super.add();
}
@Override
public int get() {
return super.get();
}
}
public class LSP {
public static void main(String[] args) {
List list = new List();
Stack stack = new Stack();
List myList = new Stack();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment