Create an abstract class called aqualife.

Assignment Help JAVA Programming
Reference no: EM13940651

Create an abstract class called Aqualife.
Aqualife has the following attributes:
name
age
lakeFish
oceanFish

Aqualife defines 2 abstract methods called eats() and procreates().
A third concrete method called breathes() displays that 'These creatures breathe from gills.'
Create subclasses of Aqualife:
Fish
Whale

Fish has an attribute which stores whether the fish is an herbivore or a carnivore. Its eats method checks whether herbivore or carnivore, and prints 'This fish eats veggies' for herbivores and 'This fish eats other fish' for carnivores. Its procreates method prints 'Fish lay eggs'.
Whale has an attribute that specifies whether the whale is a blue whale or a killer whale. If the whale is a blue whale, it eats veggies, if it is a killer whale it eats meat. Its procreates method prints that whales are mammals. It overrides the breathes method from the parent class. This method must print 'These mammals breathe above water'.

Reference no: EM13940651

Questions Cloud

Discuss the positive and negative factors : Drawing on the literature, critically discuss the positive and negative factors that may directly or indirectly influence services workers' job performance.
Determine the number of complete revolutions : A mixing drum is accelerated from 50 to 160 rpm in a time of 20 s by a driving torque of 25 Nm. Determine (a) the angular acceleration, (b) the number of complete revolutions turned, (c) the work done, (d) the average power developed, (e) the maxi..
Establishment core business activities : Outline your establishment's core business activities . If you're not currently employed, list the core business activities most relevant  to the product  or service you've chosen to promote from your training environment.
Whether toni hoffman act of whistleblowing morally justified : Using Bowie's theory assess whether Toni Hoffman's act of Whistleblowing was morally justified? 2. Will the most recent whistle-blower legislation for public officials (Public Interest Disclosure Act 2013) be sufficient in protecting whistleblower..
Create an abstract class called aqualife. : Fish has an attribute which stores whether the fish is an herbivore or a carnivore. Its eats method checks whether herbivore or carnivore, and prints 'This fish eats veggies' for herbivores and 'This fish eats other fish' for carnivores. Its procr..
Which system do you think better protects the defendant : Should the same system be used for both criminal and civil cases, or would it be better to have one system for criminal matters and the other system for civil matters? Why or why not?
Transforming the work environment of nurses : In no more than 2000 words, write an assignment on: "The USA Agency for Healthcare Research and Quality (2004) produced a document, Keeping patients safe: Transforming the Work Environment of Nurses (2004).
What does transparency mean in accounting : What does "transparency" mean in accounting? What is the term used to describe the possibility that a foreign currency will decrease in US $ value over the life of an asset such as Accounts Receivable
Provide a comprehensive idea and scope of the project : Your task is to complete the project management document to provide a comprehensive idea and scope of the project. Your submission should include the following documents:

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a java application program called largest.java

Write a Java application program called Largest.java that inputs a series of 10 single-digit numbers and determines and prints the largest of the numbers

  Write down a java gui application termed as indexjava that

write a java gui application called index.java that inputs several lines of text and a search character and uses string

  Write a static method named showtwos

Write a static method named showTwos

  Convert the while loop

Convert the while loop in the following code segment to a do-while loop

  Robot preparing for competition

Create an event so that the skateboard can be controlled by game player

  Data structures and algorithms

Code analysis and programming.

  What is the value of sum after this code sequence is execute

What are the values of i and sum after this code sequence is executed?

  Create a class diagram that shows an interface

Create a class diagram that shows an interface called Buyer in the Violet UML editor. This interface should declare the methods to perform a buyer's responsibilities

  How can an applet get information about the url

How can an applet get information about the URL it was called from? What is an applet? What API changes are there for applets with JDK 1.4?

  Discuss key environmental issues facing north america

Discuss the key environmental issues facing North America based on the discussion in the text. Which ones do you see threatening the quality of life in North America the most? Do you have any ideas on how these issues might be addressed?

  Review the threading

Threading. A considerable amount of time was spent trying to get threading to work properly. Initial designs included a thread called Turn, which would call a subsequent thread for performing communication actions with the LAMP server. Unable to..

  Arguments a minimum value and a maximum value

Write a function that takes as arguments a minimum value and a maximum value and plots sin(x) from the specified minimum to the specified maximum.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd