📚 Practice Mode

Java Practice Test - 3

Learn at your own pace with hints and detailed explanations

1 / 25
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