Commit 8fec08e3 authored by harry.sawdon's avatar harry.sawdon

First commit

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-15">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>InheritanceTest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=15
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=15
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=15
package inheritanceTest;
public class Animal {
protected String name;
protected String enviro;
protected String eats;
protected String noOfLegs;
protected String wings;
protected String Length;
protected String Description;
public Animal(){}
public Animal(String Name, String habitat, String food, String legs, String wingspan, String length, String description){
this.name = Name;
this.enviro = habitat;
this.eats = food;
this.noOfLegs = legs;
this.wings= wingspan;
this.Length= length;
this.Description = description;
}
public String getName() {
return name;
}
public void setName(String Name) {
this.name = Name;
}
public String getEats() {
return eats;
}
public void setEats(String eats) {
this.eats = eats;
}
public String getNoOfLegs() {
return noOfLegs;
}
public void setNoOfLegs(String noOfLegs) {
this.noOfLegs = noOfLegs;
}
public String getHabitat() {
return enviro;
}
public void setHabitat(String habitat) {
this.enviro = habitat;
}
public String getwingspan(String wingspan) {
return wings;
}
public void setwingspan(String wingspan) {
this.wings = wingspan;
}
public String getlength(String wingspan) {
return Length;
}
public void setlength(String length) {
this.Length = length;
}
public String getDesc(String description) {
return Description;
}
public void setDesc(String description) {
this.Description = description;
}
}
\ No newline at end of file
package inheritanceTest;
public class Bird extends Animal{
public Bird(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) {
super(Name, habitat, food, legs, wingspan, length, Description);
}
@Override
public String toString() {
return name + enviro + eats + noOfLegs + wings + Length + Description;
}
}
package inheritanceTest;
public class Fish extends Animal{
public Fish(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) {
super(Name, habitat, food, legs, wingspan, length, Description);
}
@Override
public String toString() {
return name + enviro + eats + noOfLegs + wings + Length + Description;
}
}
package inheritanceTest;
public class Mammal extends Animal{
public Mammal(String Name, String habitat, String food, String legs, String wings, String length, String Description) {
super(Name, habitat, food, legs, wings, length, Description);
}
@Override
public String toString() {
return name + enviro + eats + noOfLegs + wings + Length + Description;
}
}
package inheritanceTest;
public class Reptile extends Animal{
public Reptile(String Name, String habitat, String food, String legs, String wingspan, String length, String Description) {
super(Name, habitat, food, legs, wingspan, length, Description);
}
@Override
public String toString() {
return name + enviro + eats + noOfLegs + wings + Length + Description;
}
}
This diff is collapsed.
This diff is collapsed.
module inheritanceTest {
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment