Study your flashcards anywhere!

Download the official Cram app for free >

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

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

A key: Read text to speech.a key


Play button


Play button




Click to flip

35 Cards in this Set

  • Front
  • Back
Name the three iteration control stuctures employed by Java
While, Do/While, For loop
Which iteration control structure(s) will always execute the loop at least once ?
Whick iteration control structure(s) evaluate(s) the test expression before the loop is executed ?
Which iteration control structure(s) should be employeed when it can be determined in advance how many loop repetitions there should be ?
What will the following loop do ?

while (count < 10)
Infinite loop, since there is no increment.
Explain the difference between the execution of the Break and continue within a loop.
The break statement is used to immediately terminate a loop.

The continue statement is used to skip over a single loop iteration.
What four things must be specified in a method header ?
modifier, return type, method name and parameter list
Three possible modifers for Java methods are...
private, public and protected
Explain the difference between a void method and a non-void method.
A non-void method returns a single value to the calling program.

A void method performs specific tasks or operates on class data.
Explain the difference between and argument and a parameter.
Arguments are values/variables used within the method call. (variables r & h used in the method call)

A parameter is a variable in the method header used to accept a data item during a method call. (variables rate and hours)
T or F
When a method does not have a return type, you must indicate this with the keyword null.

(keyword is void)
When using an assignment operator to call a method, the method must include a(n) _________ statement.
T or F
A variable defined in main () has visibility in all methods called by main().

(Local to that method)
What is a local variable ?
Only visible within that block.
What is meant by the scope of a variable or method ?
From where it can be accessed.
T or F
Variables should be defined as locally as possible and constants as globally as possible.
What are the two things that make up a class declaration ?
data members & method members
What is the scope of a private class member ?
Accessible from w/in a class
What is the scope of a public class memeber ?
Accessible from outside class.
The concept of combining data with a set of operations that are dedicated to manipulating the data so tighly that outside operations cannot affect the data is called ____________.
T or F
Only public members of a given class can access the pricate members of that class.
Why are classes declared and objects defined ?
No memory is reserved for declared values, defined objects reserve memory for the value.
T or F
Utility methods are declared as private methods.
At the abstract level, a class can be described as a(n) ______ that defines the behavior of its objects.
At the implementation level, a class consists of ______ and _______ members.
Data; Method
T or F
THe abstract view of a vlass provides its inside view, showing the secrets of its data organization and mehod implementation.

(it's like a class diagram)
What is meant by the term "behavior" relative to a class object ?
OOP provides an important feature called __________, which is a mechanism for deriving new classes from existing ones.
A method that simply returns the value of a class data member is called a(n) ______ method.
What is the purpose of a constructor ?
Create & initialize an object.
A private method of a class is often called a(n) ________ method.
T or F
A constructor never has a return type, not even a void.
What operator is used to send a message to an object ?
dot operator (
Explain why you should use packages when developing Java programs.
To group similar functionality in one place.
A package called accounting must be sotred in a directory called _______.