or...
Reset Password Free Sign Up

incorrect cards (0)
correct cards (0)
remaining cards (0)
0:01
To flip the current card, click it or press the Spacebar key.  To move the current card to one of the three colored boxes, click on the box.  You may also press the UP ARROW key to move the card to the Correct box, the DOWN ARROW key to move the card to the Incorrect box, or the RIGHT ARROW key to move the card to the Remaining box.  You may also click on the card displayed in any of the three boxes to bring that card back to the center.

Pass complete!

Correct box contains:
Time elapsed:
Retries:
restart all cards


 

 
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

SCJA-drills-chap02

QuestionAnswer
What does assignment statements do? Assignment statements assign values to variables.
What do assign values to variables? Assignment statements assign values to variables.
What happens if an assignment statement do not return boolean type when used as the expression in an if statment? Assignment statements that do not return boolean types will cause the compiler to report an error when used as the expression in an if statement.
What, related to invalid literals, can cause a compiler error? Trying to save an invalid literal to a declared primitive type variable will result in a compiler error.
What are conditional statments used for? Conditional statements are used for determining the direction of flow based on conditions.
What are the conditional statements? Types of conditional statements include the if, if-then, if-then-else, and switch statements.
Where does the default statement of a switch can be placed? The default case statement can be placed anywhere in the body of the switch statement.
What must expressions used in if statments be evaluate to? The expressions used in if statements must evaluate to boolean values, or the application will fail to compile.
May Boolean wrapper classes be used in if statements? Motivate your answer? Boolean wrapper classes are allowed as expressions in if statements since they are unboxed.
What is unboxing, and what are the consequences related to their primitives? Remember that unboxing is the automatic production of primitive values from their related wrapper classes when the primitive value is required.
What are iteration statments? Iteration statements are designed for iterating through pieces of code.
Which iteration statements exist? Iteration statements include the for loop, enhanced for loop, and the while and do-while statements.
What are the main components of the for loop statement? The for loop statement has main components that include an initialization part, an expression part, and an update part.
What is the enhanced for loop statement used for? The enhanced for loop statement is used for iteration through an iterable object or array.
How would the code for a foreach loop look like in order to go through all of the String array str[]? for (String s : str) { //code }
What is the while loop statement based on? The while loop statement is used for iteration based on a condition.
Describe the do-while statement. The do-while statement is used for iteration based on a condition. The body of this statement is always executed at least once.
What the transfer of control statements do? Transfer of control statements interrupt or stop the flow of execution.
Which are the transfer of control statements? The transfer of control statements include the continue, break, and return statements.
What is the continue statement used for? The continue statement is used to terminate the current iteration of a do-while, while, or for loop, and then continue with the next iteration.
What is the break statement used for? The break statement is used to exit the body of a switch statement or loop.
What is the return statement used for? The return statement is used to exit a method and return a specified value.
What is a block? Give an example. A block is a sequence of statements within braces—for example, { int x=0; int y=1 }.
What are the pseudo-code used for? Pseudo-code allows algorithm designers to express computer programming algorithms in a human-readable format.
What does writing pseudo-code allow? Writing pseudo-code allows for the quick and focused production of algorithms based on logic, not language syntax.
How are pseudo-code algorithms written? Java keywords and statement usage structures are used when implementing pseudo-code algorithms.
Briefly describe the universally accepted standars for writing pseudo-code. There are no universally accepted standards for writing pseudo-code.
Created by: fd99 on 2010-07-07




Copyright ©2001-2013 John Weidner All rights reserved.
About -  FAQ -  Terms of Service -  Privacy Statement -  Contact -  Hide Ads  -  Mobile