Quiz3.fa09

Quiz3.fa09 - Signature cs11f CSE 11 Quiz 3 Fall 2009 Name...

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

View Full Document Right Arrow Icon
Signature _____________________ CSE 11 Name ________________________ Quiz 3 cs11f ____ Fall 2009 Student ID ____________________ This quiz is to be taken by yourself with closed books, closed notes, no calculators. What is the output produced by this program? (Hint: Draw Stack Frames!) public class Mystery { public static void main( String[] args ) { Mystery ref = new Mystery(); System.out.println( ref.mystery( 5 ) ); } private int mystery( int a ) { int b = a + 3; if ( b >= 6 ) { System.out.println( b ); b = a + mystery( a - 1 ); System.out.println( a ); } else { System.out.println( "Whoa!" ); b = a; System.out.println( a ); } return b; } } (over) Output
Background image of page 1

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

View Full Document Right Arrow Icon
Given the following definitions: And the following variable definitions: private Puppy puppy; private Kitty kitty; private Speakable speakable; Indicate which are valid Java statements. Consider each statement executed sequentially in the order it appears.
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

Quiz3.fa09 - Signature cs11f CSE 11 Quiz 3 Fall 2009 Name...

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

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