Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help i need to Create a class named Poem that contains fields for the name of the poem and the number of lines in it.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

help i need to Create a class named Poem that contains fields for the name of the poem and the number of lines in it. Include a constructor that requires values for both fields. Also include get methods to retrieve field values. Create three subclasses: Couplet, Limerick, and Haiku. The constructor for each subclass requires only a title; the lines field is set using a constant value. A couplet has two lines, a limerick has five lines, and a haiku has three lines. Create an application that demonstrates usage of an object of each type. Save the files as Poem.java, Couplet.java, Limerick.java, Haiku.java, and DemoPoems.java here is my program it gives me an error when i run the DemoPoems.java

gs Tools Window Help ame public class Poem private String poemName; private int lines; public Poem(String poemName, int lines) this.poemNamepoemName; this.lines = lines; public String getPoemName() return poemName; public int getLines() return lines

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago