The Artima Developer Community
Sponsored Link

Java Answers Forum
Please help me to understand my Java assignment

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
chuck

Posts: 9
Nickname: chuckjava2
Registered: Jul, 2002

Please help me to understand my Java assignment Posted: Jul 6, 2002 9:22 PM
Reply to this message Reply
Advertisement
I am working on this assignment, but do not really understand it. I can't tell what the output is going to be like. Please help me to understand it. Thank you very much. Here is the assignment:


Minimum Requirements

Create a hierarchy of classes (Cube, Box, Case, Suitcase, see below) to demonstrate your understanding of inheritance and polymophism; you will need additional methods and variables and should create them as appropriate. The information below constitutes general guidelines; you should be guided by your judgment.
Create a Test Applet (using JOptionPane is fine) to put your classes through the paces.
Instantiate 2 objects for each non-abstract type.
Print using instantiated objects.
Create an array of references using the base class type.
Assign instantiated objects to the array.
Print using array of references. (Need not access all subclass data.)
Change the data in the instantiated objects using the array.
Print again.
Print a message to the console using System.out.println in each method you write (e.g., "in class.method").
Document your code professionally.
Be creative.

Cube abstract

width double
height double
depth double
isOpen boolean
getArea() double
open() abstract String
close() abstract String
getName()[should be implemented] String
toString() [should be implemented] String



Box subclass of Cube

numberOfFlaps
positionOfFlaps
foldFlaps()
open ()
close()
getName()
toString()



Case subclassof Cube

positionOfLid
latchOpen boolean
closeLatch()
open()
close()
getName()
toString()



Suitcase subclass of Case

zipperOpen boolean
positionOfLid
latchOpen boolean
closeZipper()
closeLatch()
open()
close()
getName()
toString()

Topic: JVM INSTR Previous Topic   Next Topic Topic: how do i fix Error establishing socket

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use