Purchase Solution

Java Programming

Not what you're looking for?

Ask Custom Question

See attach files. I am having a hard time to figure out how to display the output. I was trying to use the my.displayInformation(); clause but wasnt sucessful. Any help would be greatly apperciated.

Write a Java program that does the following:
1. Creates a Ball class with attributes for color, hardness, and size and instantiates the following Ball objects: golf, baseball, soccer.
2. Creates a display method which can print the current state of the attributes for all objects.
3. Creates attributes that have default values (your choice) which will display to the screen when the program is run and then each of the attributes for each object will be changed (your choice) during the program run and printed again to the screen with the appropriate message so that I can tell what the original values were and how they were changed during the program run.
Your output should be as follows:
A. Print each ball type's default attribute values i.e., "The golf ball color = white, hardness = hard, and size = small"
B. Change each ball type's default attribute values and print the changes i.e., "The golf ball is now color = orange, hardness = soft, and size = large."

Purchase this Solution

Purchase this Solution

Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Javscript Basics

Quiz on basics of javascript programming language.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.