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

BIN
test/Cat.class Normal file

Binary file not shown.

27
test/Cat.java Normal file
View File

@ -0,0 +1,27 @@
public class Cat {
protected String name;
protected String color;
public Cat (String name, String color) {
this.name = name;
this.color = color;
}
public String getColor() {
return color;
}
public String getName() {
return name;
}
public void setName(String catName) {
name = catName;
}
public String catSays() {
return "Meow";
}
}

6
test/CatTest.java Normal file
View File

@ -0,0 +1,6 @@
public class CatTest {
public static void main(String[] args) {
Cat orangesmall = new Orange("Turuncu");
System.out.println(orangesmall.getColor()+" rengi ismi de: "+orangesmall.getName()+" ve kilosu: "+orangesmall.Weight());
}
}

BIN
test/Orange.class Normal file

Binary file not shown.

13
test/Orange.java Normal file
View File

@ -0,0 +1,13 @@
public class Orange extends Cat
{
private int weight = 5;
public Orange (String name) {
super(name, "Orange");
}
public int Weight() {
return weight;
}
}