This commit is contained in:
2025-01-13 03:59:28 +03:00
parent a5b35aabb3
commit aea61f2076
14 changed files with 194 additions and 0 deletions

26
labs/lab7/Yorkshire.java Normal file
View File

@ -0,0 +1,26 @@
// ****************************************************************
// Yorkshire.java
//
// A class derived from Dog that holds information about
// a Yorkshire terrier. Overrides Dog speak method.
//
// ****************************************************************
public class Yorkshire extends Dog
{
private final int breedweight = 15;
public Yorkshire(String name)
{
super(name);
}
// ------------------------------------------------------------
// Small bark -- overrides speak method in Dog
// ------------------------------------------------------------
public String speak()
{
return "woof";
}
public int avgBreedWeight() {
return breedweight;
}
}