Question: public class Box { String BoxColor = blue; String BoxName; double BoxWeight; public void setBoxColor(String color) { BoxColor = color; } public String getBoxName() {

public class Box

{

String BoxColor = blue;

String BoxName;

double BoxWeight;

public void setBoxColor(String color)

{

BoxColor = color;

}

public String getBoxName()

{

return BoxName;

}

}

a) How many field attributes are there in the Box class? (2 marks)

b) What is the name of the method that is an accessor? (2 marks)

c) What is the default value of BoxWeight when a new object is created? (2 marks)

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!