time()) die(); ?> AP CS
Loading
notes intro/old submit AP Problems the dump links
 

Quiz 7 - Strings

 

id:

1. How many parameters does substring take

0 1 2 1 or 2

2. True or false: compareTo returns a boolean: true false

3. True or false: the .equals method takes in no arguments true false

4. Predict the output:
String a="MYLAD VLAD!";
System.out.print(a.length());
  
10 11 12 error - you need to put an escape sequence before the !

 

5. Predict the following output

String a="MYLAD VLAD!";
System.out.print(a.substring(3));

AD VLAD! D VLAD! LAD VLAD! MYL

 

6.Predict the output from the following statements


String a="MYLAD VLAD!";
System.out.print(a.substring(3,9));

LAD VLA LAD VLAD AD VLAD! AD VLA AD VLAD

 

7. What is returned by the following statement:

 



String a="MYLAD VLAD!";
System.out.print(a.charAt(3));