____ Methods Are Methods That Exist To Be Used With An Object Created From A Class.

AP Computer Science: Mid-Term

formal____ parameters are variables in a method declaration that accept the values from the actual parameters
compositionWhen an object of one class is a data field within another class, they are related by _____.
masksA locally declared variable always ____ another variable with the same name elsewhere in the class.
TrueIt is illegal to declare the same variable name more than once within a block
TrueApplication classes frequently instantiate objects that use the objects of other classes
staticIt is not necessary to create an instance of the Math class because the constants and methods of the class are ____
constructorA(n) ____ method is a method that creates and initializes class objects constructor.
firstWhen calling this() from a constructor, it must be the ____ statement within the constructor
methodA(n) ____ is a program module that contains a series of statements that carry out a task
neverYou are ____ required to write a constructor method for a class
main()The ____ method executes first in an application, regardless of where you physically place it within its class
this referenceThe reference to an object that is passed to any object’s nonstatic class method is called the ____
breakYou can leave out the ____ statements in a switch structure
implementation hiding____ is the encapsulation of method details within a class
conditional OR operatorYou can use the ____, which is written as ||, if you want some action to occur when at least one of two conditions is true
FalseIn the switch structure, break is followed by one of the possible values for the test expression and a colon
decision structureA ____ checks a value, and based on the result performs one of two actions
importThe ____ statement notifies the program that you will be using the data and method names that are part of the imported class or package
blockWithin any class or method, the code between a pair of curly braces is called a(n) ____
dual-alternative ifA(n) ____ statement is the decision structure you use when you need to take one or the other of two possible courses of action
TrueWhen you use nested if statements, you must pay careful attention to placement of any else clauses
extendedPublic classes are accessible by all objects, which means that public classes can be ____, or used as a basis for any other class
FalseWhen you write your own constructors, you cannot write versions that receive parameters
defaultA(n) ____ constructor is one that requires no arguments
newIn order to allocate memory for an object, you use the ____ operator
flowchartA ____ consists of written steps in diagram form, as a series of shapes connected by arrows
TrueAn application’s main() method must have a void return type
switchThe ____ statement is useful when you need to test a single variable against a series of exact integer, character, or string values
overrideObject-oriented programmers use the term ____ when a child class contains a field or method that has the same name as one in the parent class
TrueAs long as you do not make any ambiguous method calls, a program that contains a potentially ambiguous situation will execute correctly
memberAn object is a ____ of a class
range checkA(n) ____ is a series of if statements that determine whether a value falls within a specified range
elseJust as you can block statements that depend on an if, you can also block statements that depend on a(n) ____
TrueAny class can contain an unlimited number of methods
wildcard symbolYou can use the asterisk (*) as a ____, which indicates that it can be replaced by any set of characters
FalseWhen writing a statement with the two-line format, you must be sure to type a semicolon at the end of the first line in order to ensure accurate results
goes out of scopeWhen a variable ceases to exist at the end of a method, programmers say the variable ____
Class____ variables are variables that are shared by every instantiation of a class
Boolean fields set to trueWhich of the following is NOT an initial value assigned to an object’s data field by a default constructor? a field of object references set to null
FalseIf you give the same name to a class’s instance field and to a local method variable, the instance variable overrides the method’s local variable
constructorYou can use ____ arguments to initialize field values, but you can also use arguments for any other purpose
falseAlthough it is possible to block statements that depend on an if, you cannot likewise block statements that depend on an else
localA(n) ____ variable is known only within the boundaries of the method instance
falseIf an integer is passed to a method with a double parameter, the double is promoted to an integer
falseA disadvantage of Java is the large memory requirements to store a separate copy of each variable and method for each instantiation of a class
TrueAn alternative to using a Boolean expression, such as someVariable == 10, is to store the Boolean expression’s value in a Boolean variable
overloadWhen you properly ____ a method, you can call it providing different argument lists, and the appropriate version of the method executes
declarationThe method ____ is the first line of a method
parenthesesWhen working with logical operators, you can always use ____ to change precedence
memory addressesWhen using equals and not equals for comparisons with objects, you compare the objects’ ____ instead of actual values
TrueYou can use the keyword final with methods or classes
falseWhen you create a block, you must place multiple statements within it
Boolean expressionWhen you execute an if…else statement, only one of the resulting actions takes place depending on the evaluation of the ____ following the if
methodsWhen they have the same name, variables within ____ of a class override the class’s fields
comes into scopeA variable comes into existence, or ____, when you declare it
finalThe keyword ____ indicates that a field value is unalterable
falseWhen a value is returned from a method, you are required to use the value when the method is called
andThe ____ operator is always evaluated before the OR operator
constructorThe name of the ____ is always the same as the name of the class whose objects it creates
single equal signWhen an expression containing a ____ is part of an if statement, the assignment is illegal
instanceMethods used with object instantiations are called ____ methods
java.langThe ____ package contains frequently used classes and is implicitly imported into Java programs
objectIf a class’s only constructor requires an argument, you must provide an argument for every ____ of the class that you create
ampersandsThe AND operator is written as two ____
accessorMethods that retrieve values are called ____ methods
notThe ____ operator is written as the exclamation point ( ! )
falseA method’s identifier must be more than one word, must have no embedded spaces, and cannot be a Java keyword
parameterWhen an application contains just one version of a method, you can call the method using a(n) ____ of the correct data type
doubleDue to automatic type promotion, when a method with a double parameter is passed an integer, the integer will be promoted to a(n) ____
TrueYou can identify a class that is an application because it contains a public static void main() method
return statementA(n) ____ causes a value to be sent from a called method back to the calling method
variableWhen you block statements, you must remember that any ____ you declare within a block is local to that block
falseA block can exist entirely within another block or entirely outside and separate from another block, and sometimes blocks can overlap
nestedStatements in which an if structure is contained inside another if structure are commonly called ____ if statements
curly bracesWhen you place a block within an if statement, it is crucial to place the ____ correctly
integerA method can receive ____ arguments, even if it is defined as needing double arguments
overloading____ involves using one term to indicate diverse meanings, or writing multiple methods with the same name but with different parameter lists
TrueParentheses in a method declaration contain parameters that are funneled into the method
signatureThe compiler determines which version of a method to call by the method’s ____
memoryWhen you instantiate an object from a class, ____ is reserved for each instance field in the class
TrueAn alternative to importing a class is to import an entire package of classes
TrueRange checking and the switch statement are tools programmers can use for effective decision making
TrueAlthough not required, it is common procedure to align the keyword if with the keyword else
Boolean expressionFailing to include a complete ____ on each side of an && operator in an if statement is a common error in Java programming
arguments headersData items you use in a call to a method are called ____
ifThe simplest statement you can use to make a decision is the ____ statement
logicThe compiler does not take indentation into account when compiling code, but consistent indentation can help readers understand a program’s ____
tasksIt is a convenience to be able to use one reasonable name for ____ that are functionally identical except for argument types
sequenceA logical structure called a(n) ____ structure is when one step follows another unconditionally
actual parametersThe arguments in a method call are often referred to as ____
conditional operatorThe ____ requires three expressions separated with a question mark and a colon
TrueYou write pseudocode in everyday language, not the syntax used in a programming language
TrueWhen you overload a Java method, you write multiple methods with a shared name