Java Practice Test - 3

Casual Mode - Take your time!

1 / 25
Correct
0
Incorrect
0
Score
0%
Multiple Choice

After the following code fragment, what is the value in fname?
String str;
int fname;
str = "Foolish boy.";
fname = str.indexOf("fool");

  1. 0
  2. 2
  3. -1
  4. 4
Change Mode