• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
Front

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

image

PLAY BUTTON

image

PLAY BUTTON

image

Progress

1/11

Click to flip

11 Cards in this Set

  • Front
  • Back
What does the phrase short circuit mean?
Once the answer is known - stop evaluation of the expression. For example, if a program contained the line "if(x > 5 || y > 5)" then the sub-expression "y > 5" would only be evaluated if the sub-expression "x > 5" was false.
What is the result of the following code snippet:

if(i > 10)

i = 10;

System.out.println("i was greater than 10");
In cases where the variable i was greater than 10, i will be set to 10. In all cases the string "i was greater than 10" will be printed.
How can you avoid confusion when using nested if-elses?
By indenting and blocking carefully, code readability can be drastically improved. This can significantly reduce the number of bugs present in your code.
What does is the function of the key word final?
Final signifies a variable whose value will not and can not change. It can help a programmer avoid bugs when using a value that should remain constant because the IDE will raise an error flag if you attempt to change a final variable from its initial value.
What constitutes a legal variable name?
o All characters must be letters, digits, $, or _.

o Variable names can't start with a digit, $, or _.

o Variable names can't be reserved words (i.e. final, class, public).
What convention is used in java for variables names of more than one word?
Camel case. For example, dataList, myFavoriteMartian, or showMeTheMoney.
What feature is used to execute the same line(s) of code multiple times?
A loop.
What is the difference between a while-loop and a do-while-loop?
A do-while-loop is always executed at least once, where as a while-loop is never executed if the condition is initially false.
What type of loop should be used to execute a body of code a set number of times?
A for-loop.
What is the scope of a global variable?
An entire program.
What is the scope of a local variable?
A block.