Multiple Choice Question

Quiz Guidelines

 

QID: 
372
Question: 

Consider the following code:

class Base{
private float f = 1.0f;
void setF(float f1){ this.f = f1; }
}class Base2 extends Base{
private float f = 2.0f;        //1
}

Which of the following options is a valid example of overriding?

Select 2 options

A. protected void setF(float f1){ this.f = 2*f1; }
B. public void setF(double f1){ this.f = (float) 2*f1; }
C. public void setF(float f1){ this.f = 2*f1; }
D. private void setF(float f1){ this.f = 2*f1; }
E. float setF(float f1){ this.f = 2*f1; return f;}

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!