Write a Java program according to the instructions.

Write a Java program according to the followings:

  1. Super class named Animal as the followings:
    1. Implements the two interface FinalExam and MidExam
    2. instance variable: String name.
    3. instance variable: String voice.
    4. Public constructor receives two string argument to set instance variable
    5. Public method get_name returns animal name.
    6. Public method get_voice returns animal voice.
  2. Subclass named Cat inherits Animal
    1. Instance variables: String type;
    2. Public constructor receives three arguments to set instance variables, (name, voice, type) and then call Animal constructor
    3. Public method getType returns Cat type;
  3. Subclass class named Dog that inherits Animal
    1. Instance variables: String type;
    2. Public constructor receives three arguments to set instance variables, (name, voice, type) and then call Animal constructor
    3. Public method getType returns Dog type;
  4. An interface named FinalExam
    1. This interface contains one integer value which is equal to 10 and named x.
    2. This interface contains three methods:
      1. First method name is getName.
      2. Second method is getZone.
      3. Third method is getCategory.
  5. An interface named MidExam
    1. This interface inherit FinalExam
    2. This interface contains three methods:
      1. First method name is getName.
      2. Second method is getZone.
      3. Third method is getCategory.
  6. Main program
    1. Create object name a with reference Animal and Cat object.
    2. Create object name b with reference Animal and Dog object.
    3. Call all methods inside Cat class
    4. Call all methods inside Dog class
    5. Use exception handling

in progress
Programming in Java 1 Answer Anonymous(s) Post