quiz10 - Name: _ Section: Dave's 15-100 M N O P April 1,...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Name: ____________________ Section: M N O P Dave's 15-100 April 1, 2009 Quiz 10 1. Consider the following code segment carefully . if (n == 4) System.out.print(" Dave "); else if (n > 2) System.out.print(" Frodo "); if (n < 6) System.out.print(" Harry "); else System.out.print(" Luke "); If n is 1, what name or names will be printed? ______________________________ If n is 3, what name or names will be printed? ______________________________ If n is 4, what name or names will be printed? ______________________________ If n is 5, what name or names will be printed? ______________________________ If n is 7, what name or names will be printed? ______________________________
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Reference: String Class boolean equals (String other) int length () String substring(int from, int to) Returns the substring beginning at from and ending at to-1 . String substring(int from) Returns substring(from, length()) . int indexOf(String s)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

quiz10 - Name: _ Section: Dave's 15-100 M N O P April 1,...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online