Question: can i get help with this java question please A Box class Consider the class public class Box extends Objectf private String stuff: Constructors Write

 can i get help with this java question please A Box

can i get help with this java question please

A Box class Consider the class public class Box extends Objectf private String stuff: Constructors Write two constructors for the class. The first constructor will take zero input arguments and set the stuff attribute to null. The second will take a String as input and set the stuff attribute to input string Getter and Setter Write a public getter method called getStuff that returns the string stored by the stuff attribute. If stuff is null, it should return the string "no stuff in here". Write a public setter method called setStuff that takes a string as input. If the stuff attribute is currently null, the method sets it to the input string. If stuff is not null, then it replaces its value with the concatenation of the input string with the character "" and then with the current string in stuff. For example, Box b = new Box(); // stuff is null b.getstuff b.setStuff ("cat"); // stuff is "cat" b.setstuff ("dog"): // stuff is "doglcat" // returns "no stuff in here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!