Question: Consider the following class: public class RGB { private int r; private int g; private int b; public RGB ( int red, int green, int
Consider the following class:
public class RGB
private int r;
private int g;
private int b;
public RGBint red, int green, int blue
r red;
g green;
b blue;
public boolean equalsRGB other
return thisr other.r &&
thisg other.g &&
thisb other.b ;
public void setGreenint green
this.g green;
other gettersetter methods present, but not shown
What value is assigned to the variable b in the following code segment?
RGB c new RGB;
RGB c c;
csetGreen;
boolean b cequalsc;
Group of answer choices
an error occurs
No answer text provided.
false
true
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
