The Artima Developer Community
Sponsored Link

Java Answers Forum
help..

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
joy guinto

Posts: 1
Nickname: trese
Registered: Dec, 2009

help.. Posted: Dec 1, 2009 5:04 AM
Reply to this message Reply
Advertisement
Create two classes, Vehicle and Engine, with no-arg constructors. Vehicle's constructor should print "I'm a Vehicle!" to the standard output, and Engine's constructor should print "I'm an Engine!". Create a new class PickupTruck and declare it a subclass of Vehicle. Create an instance variable in PickupTruck that is of type Engine and initialize it (with an initializer) to a new instance of class Engine. Class PickupTruck should have no constructors or methods, just the instance variable. In the main() method of a class named Problem2, create an object of class PickupTruck. Run the Problem2 application and observe the results.

im so confused..
can anyone give me the right answer for this??
t

Topic: New to Java? Previous Topic   Next Topic Topic: write/read two byte arrays to one file-  help!

Sponsored Links



Google
  Web Artima.com   

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