Limited access

Upgrade to access all content for this subject

Consider the following code.

String s1="Sorry", s2="sorry", s3="shelves";
boolean answer1 = s1.compareTo(s2)==0;
boolean answer2 = !(s1.compareTo(s3)<0);
boolean answer3 = !(s1.substring(2,3).equals(s2.substring(3,4)));
boolean answer4 = !(s2.length()<s3.indexOf("e"));
boolean answer5 = s1.length()-2==s3.substring(2).indexOf("v");

How many of these boolean variables are initialized to false?

A

1

B

2

C

3

D

4

E

5

Select an assignment template