09_Quiz - for Fraction in Chapter 8. Use the following...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
AP Computer Science Name ____________________________ Quiz – Reading Chapter 9 Strings 15 points 1. How should the literal strings be written for the following outputs? Just the string not System.out…. 2pts each a. He said “Hello.” ______________________________________________ b. c:\jdk1.4.2\docs ______________________________________________ 2. Other than the constructor, String ( ), write a one line command that initiates str to an empty string. 4pts __________________________________________________________________ 3. True or False: Since strings change we need copy constructors similar to what we had 1 pt.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for Fraction in Chapter 8. Use the following string assignments to answer questions #4 9. (1 pt each) String s1 = Leap String s2 = Year String s3 = Frog String s4 = Mississippi 4. s1 + s2 _________________________________________________ 5. s1.concat(s3) ___________________________________________ 6. s3.length _______________________________________________ 7. s2.indexOf(e) ________________________________________ 8. s2.indexOf(e, 2) ________________________________________ 9. s4.lastIndexOf(i) ________________________________________...
View Full Document

Ask a homework question - tutors are online