Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. Write the statement that would assign your name to the memory location declared above. _____________________________________________________________________________ 6. What was the name of the method in

5. Write the statement that would assign your name to the memory location declared above. _____________________________________________________________________________ 6. What was the name of the method in the Ball class that displayed information about the ball? _ _____________________________________________________________________________ 7. Write the Java command that would display the current owner of the credit card object - whomever it was at any time. (Writing the method is not necessary here just the display statement.) It might look like this with the blank filled with the current owners name: _____________________________________________________________________________ 8. Explain the difference between an accessor and a mutator method. Give an example of each from the Student class (lab-classes project). _________________________________________ _____________________________________________________________________________

code

/** * Write a description of class ball here. * * @author (your name) * @version (a version number or a date) */ public class ball { // instance variables - replace the example below with your own private String color; private int diameter;

/** * Constructor for objects of class ball */ public ball() { // initialise instance variables color = "red"; diameter = 10; }

/** * An example of a method - replace this comment with your own * * @param y a sample parameter for a method * @return the sum of x and y */ public String getColor(){ return color; } public int getDiameter(){ return diameter; } public void setYellowColor(){ color = "yellow"; } public void setOrangeColor(){ color = "orange"; } public void setBallColor(String setColor){ color = "setColor"; } }

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

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

Students also viewed these Databases questions

Question

Question Can a Keogh plan fund be reached by the owners creditors?

Answered: 1 week ago

Question

Question What happens to my plan if I die?

Answered: 1 week ago