*Based on answers A-E, which option is correct?
3. Given the following code, which is a n "instance variable" of the "Fruits" class?
class Fruits
{
public weight;
Fruits(double w) { weight = w; int height = 10}
public setHeight() { int h = 15; }
}
A. weight
B. height
C. w
D. h
E. All of the options
The correct option is:
A. weight
Comments
Leave a comment