-
-
Save lyxal/423c8bd590b05127e11d0e20c0ba7958 to your computer and use it in GitHub Desktop.
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 Controller { | |
public static void main(String[] args){ | |
Mammal joe = new Mammal(); | |
Dog other = new Dog("Not Joe", 69); | |
joe.speak(); | |
other.speak(); | |
joe.printInformation(); | |
other.printInformation(); | |
joe.<Integer, Integer>setAttribute(Mammal.AGE, 20); | |
other.<Integer, Float>setAttribute(Mammal.WEIGHT, Float.valueOf("69.420")); | |
joe.printInformation(); | |
other.printInformation(); | |
} | |
} |
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 Dog extends Mammal { | |
public Dog(){ | |
super(); | |
noise = "bark or something idk"; | |
} | |
public Dog(String pName, int pAge){ | |
super(pName); | |
age = pAge; | |
noise = "bark or something idk"; | |
} | |
public Dog(String pName, int pAge, float pWeight){ | |
super(pName, pAge); | |
weight = pWeight; | |
noise = "bark or something idk"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment