I need help with this


Mammal:
public class Mammal extends Pet{
String Vaccination="";
public Mammal(String name, String parent, String
species, String birthday, String Vaccination) {
//Accessing
the super class Constructor and setting the variables.
super(name,parent,species, birthday);
this.Vaccination=Vaccination;
} // end Mammal
public String getVaccination() {
return
Vaccination;
} // end getVaccination
public void setVaccination(String
Vaccination) {
this.Vaccination =
Vaccination;
} // end setVaccination
@Override
public String toString() {
return
super.toString()+". This Mammal requires following vaccinations "+
Vaccination;
} // end toString
} // end class Mammal
Reptile:
public class Reptile extends Pet{
String environment="";
public Reptile(String name, String parent,
String species , String birthday, String environ) {
//Accessing the super
class Constructor and setting the variables.
super(name,parent,species,
birthday);
this.environment=environ;
} // end Reptile
public String getEnvironment() {
return
environment;
} // end method getEnvironment
public void setEnvironment(String
environment) {
this.environment =
environment;
} // end method setEnvironment
@Override
public String toString() {
return
super.toString()+". The Reptile's required environment is "+
environment;
} // end method toString
} // end class Reptile
Note: Could you plz go through this code and let me
know if u need any changes in this.Thank You
_________________
// Pet.java
public class Pet {
private String name;
private String species;
private String parent;
private String birthday;
public Pet() {
this.name = "";
this.species = "";
this.parent = "";
this.birthday = "";
}
public Pet(String name, String species, String
parent, String birthday) {
this.name = name;
this.species = species;
this.parent = parent;
this.birthday = birthday;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSpecies() {
return species;
}
public void setSpecies(String species) {
this.species = species;
}
public String getParent() {
return parent;
}
public void setParent(String parent) {
this.parent = parent;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
@Override
public String toString() {
return "Pet : Name=" + name + ",
Species=" + species + ", Parent="
+ parent + ", Birthday=" + birthday;
}
}
_____________________
// Mammal.java
public class Mammal extends Pet {
String Vaccination = "";
public Mammal(String name, String parent, String
species, String birthday,
String
Vaccination) {
// Accessing the super class
Constructor and setting the variables.
super(name, parent, species,
birthday);
this.Vaccination =
Vaccination;
} // end Mammal
public String getVaccination() {
return Vaccination;
} // end getVaccination
public void setVaccination(String Vaccination)
{
this.Vaccination =
Vaccination;
} // end setVaccination
@Override
public String toString() {
return super.toString()+ ". This
Mammal requires following vaccinations "+ Vaccination;
} // end toString
} // end class Mammal
________________________
// Reptile.java
public class Reptile extends Pet{
String environment="";
public Reptile(String name, String parent, String species , String
birthday, String environ) {
//Accessing the super class Constructor and setting the
variables.
super(name,parent,species, birthday);
this.environment=environ;
} // end Reptile
public String getEnvironment() {
return environment;
} // end method getEnvironment
public void setEnvironment(String environment) {
this.environment = environment;
} // end method setEnvironment
@Override
public String toString() {
return super.toString()+". The Reptile's required environment is "+
environment;
} // end method toString
} // end class Reptile
_______________________
// Test.java
public class Test {
public static void main(String[] args) {
Pet p=new Pet("Kitty","Profelis
Aurata","Billy","2007/02/28");
Mammal m=new Mammal("Bear","Boxy","Ursus
Maritimus","2010/02/29","Purevax");
Reptile r=new Reptile("Crocodile", "Milly","pterosaurs"
,"2017/03/31", "Water");
System.out.println(p);
System.out.println(m);
System.out.println(r);
}
}
_________________________
Output:
Pet : Name=Kitty, Species=Profelis Aurata,
Parent=Billy, Birthday=2007/02/28
Pet : Name=Bear, Species=Boxy, Parent=Ursus Maritimus,
Birthday=2010/02/29. This Mammal requires following vaccinations
Purevax
Pet : Name=Crocodile, Species=Milly, Parent=pterosaurs,
Birthday=2017/03/31. The Reptile's required environment is
Water
_______________Could you plz rate me well.Thank
You
I need help with this Mammal: public class Mammal extends Pet{ String Vaccin...
public class Pet { //Declaring instance variables private String name; private String species; private String parent; private String birthday; //Zero argumented constructor public Pet() { } //Parameterized constructor public Pet(String name, String species, String parent, String birthday) { this.name = name; this.species = species; this.parent = parent; this.birthday = birthday; } // getters and setters public String getName() { return name; ...
*PLEASE HELP ASAP*
Pet.java
/*
* Class Pet
*
*
*
*/
public class Pet
{
/*
* Instance variables
*/
private String name;
private String species;
private String parent;
private String birthday;
/*
* Constructors
*/
public Pet( )
{
// This is a null or default constructor
} //e end null constructor
public Pet( String aName,
String aSpecies,
String aParent,
String aBDay )
{
setName( aName );
setSpecies( aSpecies );
setParent( aParent );
setBirthday( aBDay );
} //...
Code in JAVA
UML
//TEST HARNESS
//DO NOT CHANGE CODE FOR TEST HARNESS
import java.util.Scanner; // Scanner class to support user input
public class TestPetHierarchy
{
/*
* All the 'work' of the process takes place in the main method. This is actually poor design/structure,
* but we will use this (very simple) form to begin the semester...
*/
public static void main( String[] args )
{
/*
* Variables required for processing
*/
Scanner input = new Scanner( System.in...
Please help to answer ASAP
Class Parent {Parent(String s) {System.out.println("S1");}} class Child extends Parent {public Child() {System.out.println("S2");}} Identify the correct statements for the above code snippet super();//automatically inserted here in class file of Child super("Hello");//inserted here in class file of Child compilation error Compiles successfully
Hey I really need some help asap!!!! I have to take the node class that is in my ziplist file class and give it it's own file. My project has to have 4 file classes but have 3. The Node class is currently in the ziplist file. I need it to be in it's own file, but I am stuck on how to do this. I also need a uml diagram lab report explaining how I tested my code input...
Hi ! I need help please, I want to write java code, but that is difficult for me. it is about using annotation, reflection and XLM_ file. Please help me! I want explaintion with code and I want to se result please! My assignment is! Using the annotations and reflection API write an XML file exporter for composite objects of any kind. That is, the exporter should rely only on the annotations in the class definitions of the composite objects...
Write a class named Octagon (Octagon.java) that extends the following abstract GeometricObject class and implements the Comparable and Cloneable interfaces. //GeometricObject.java: The abstract GeometricObject class public abstract class GeometricObject { private String color = "white"; private boolean filled; private java.util.Date dateCreated; /** Construct a default geometric object */ protected GeometricObject() { dateCreated = new java.util.Date(); } /** Construct a geometric object with color and filled value */ protected GeometricObject(String color, boolean filled) { dateCreated = new java.util.Date(); this.color = color;...
could you please help me with this problem, also I
need a little text so I can understand how you solved the
problem?
import java.io.File; import java.util.Scanner; /** *
This program lists the files in a directory specified by * the
user. The user is asked to type in a directory name. * If the name
entered by the user is not a directory, a * message is printed and
the program ends. */ public class DirectoryList { public static...
I need help running this code. import java.util.*; import java.io.*; public class wordcount2 { public static void main(String[] args) { if (args.length !=1) { System.out.println( "Usage: java wordcount2 fullfilename"); System.exit(1); } String filename = args[0]; // Create a tree map to hold words as key and count as value Map<String, Integer> treeMap = new TreeMap<String, Integer>(); try { @SuppressWarnings("resource") Scanner input = new Scanner(new File(filename));...
I need help in converting this into pseudo-code Student.java public class Student implements Comparable<Student>{ private String name, major, status; private int rank; public Student() { this.name = this.major = this.status = ""; this.rank = 0; } public Student(String name, String major, String status) { this.name = name; this.major = major; this.status = status; } public String getName() { return name; } public String getMajor() { return major; } public String getStatus() { return status; } public int...