assignmentS1

This commit is contained in:
2025-02-19 00:21:28 +03:00
parent 1702b10d27
commit 2c4a3a53b9
4 changed files with 141 additions and 0 deletions

View File

@ -0,0 +1,27 @@
package assignments.AssigmentS1;
class Kangal extends Dog {
String Protects;
Kangal() {
name = "Aslan Korur";
color = "Yellow";
breed = "Protect Dog";
hungry = 0; // If 1 then hungry
Protects = "Sheep";
}
public String guard() {
return "ON DUTY! and Protects: " + Protects;
}
public String wag_tail() {
return "No wag!";
}
void protectedAnimal(String Protects) {
this.Protects = Protects;
}
}