Java Inheritance

Example

public class Animal {
  String name;
  int legs;
  String getInfo() {
    return name + ", " + legs;
  }
}
public class Tiger extends Animal {

}
public class Chicken extends Animal {
  int wings;

  @Override
  String getInfo() {
    return name + ", " + legs + " legs, " + wings + " wings";
  }
}
What Else?
inflearn react api server -50% 할인쿠폰: 15108-f2af1e086101 buy me a coffee