196k views
0 votes
1) Create a class called Villain. Specifically, a Villain has the following fields: .name (String)

a number of evil plans (int) In addition, a Villain has the following methods: • a constructor that accepts an argument for each of the fields . a copy constructor
an equals method, which checks/returns whether all the fields are the same
a toString method
2) Create a class called Crazy Villain, which inherits from Villain. Specifically, a Crazy Villain has the following additional fields:
a crazy laughter (String)
a crazy idea (String In addition, write code for the following Crazy Villain methods:
a constructor that accepts an argument for each of the fields
a toString method that overrides the Villain toString method, in order to include the additional fields You do not need to instantiate/demo Villain or Crazy Villain objects.

User EldadT
by
5.8k points

1 Answer

4 votes

Answer:

Step-by-step explanation:

The following code is written in Java and creates both of the classes as requested with their variables and methods as needed. The crazyVillain class extends the Villain class and implements and overrides the needed variables and methods. Due to technical reasons, I have added the code as a txt file below.

1) Create a class called Villain. Specifically, a Villain has the following fields-example-1
User Onemorecupofcoffee
by
4.7k points