Section 1

Preview this deck

Named computer memory locations are called ____

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (90)

Section 1

(50 cards)

Named computer memory locations are called ____

Front

Variables

Back

The operator that combines two conditions into a single Boolean value that is true when at least one of the conditions is true is ____.

Front

||

Back

Which of the following is not a type of it statement?

Front

Reserve if

Back

You can use the statement to terminate a switch structure

Front

break

Back

When you perform arithmetic with values of diverse types, Java

Front

implicitly converts the values to an unifying type

Back

Which of the following displays "Error" when a student ID is less than 1000 or more than 9999?

Front

if (stuID < 1000 ) System.out.println("Error"); else if (stuID > 9999) System.out.println("Error");

Back

The argument testing in a switch structure can be any of the following except a(n) ____.

Front

double

Back

When you code an if statement within another if statement, as in the following then the if statements are ____. if (a > b) if (c > d) x = 0;

Front

Nested

Back

Which of the following groups has the lowest operator precedence?

Front

Logical OR

Back

A decision is based on a(n) ____ value

Front

Boolean

Back

Assuming you have declared shoeSize to be a variable of type int, which of the following is a valid assignment statement in Java?

Front

shoeSize = 9;

Back

An instance of a class in a(n)___

Front

Object

Back

According to the rule of operator precedence, when division occurs in the same arithmetic statement as _____, the division operation always takes place first

Front

Subtraction

Back

What is the output of the following code segment? t = 10 if ( t > 7) System.out.print("AAA"); System.out.print("BBB");

Front

AAA

Back

Which assignment is correct in Java? Char = W

Front

Char aChar="W";

Back

You save text files containing Java source code using the file extension ___.

Front

.Java

Back

The command to execute a compiled Java application is ____.

Front

Javac

Back

All java applications must have a method named ___.

Front

main()

Back

In a Java program, you must use ____ to separate classes, objects, and methods

Front

Dots

Back

The logical structure in which one instruction occurs after another with no branching is a

Front

Sequence

Back

When stat cannot be changed after a class is compiled, the data is ____.

Front

Constant

Back

Which of the following data types can store a value in the least amount of memory?

Front

Byte

Back

In Java, the value of (4 > 7) is ____.

Front

False

Back

A boolean variable can hold

Front

The value of true or false

Back

The individual operations used in a computer program are often grouped into logical units called ____.

Front

Procedures

Back

Java supports three types of comments: ____ , _____, and javadoc

Front

Line, block

Back

An escape sequence always begins with a(n)

Front

Backslash

Back

Which java statement produces the following output? w Xyz

Front

System.out.println("w
Xyz");

Back

The assignment operator in Java is

Front

=

Back

Which of the following is not a primitive data type in Java

Front

Sector

Back

You must compile classes written in Java into

Front

Source code

Back

What is the output of the following code segment? t = 7 if (t > 7) System.out.print("AAA"); System.out.print("BBB");

Front

BBB

Back

Java is architecturally

Front

Neutral

Back

the "equal to" relational operation is _____.

Front

==

Back

Which of the following elements is not required in a variable declaration?

Front

An assigned value

Back

Arguments to methods always appear within ___.

Front

Curly braces

Back

After you write and save a java application file, you ____ it

Front

Compile and then resave

Back

Assuming the variable q has been assigned the value 3, which of the following statements displays XXX?

Front

if ( q >7); System.out.println("XXX");

Back

If you attempt to add a float, an int, and a byte, the result will be a(n)

Front

float

Back

The operator that combines two conditions into a single Boolean value that is true only when both of the conditions are true, but is false other wise, is ____.

Front

&&

Back

All java programming statements must end with a ___

Front

Semicolon

Back

You use a ____ to explicitly override an implicit type

Front

Type cast

Back

The values of an object's attributes are also known as its

Front

State

Back

Nonexecuting program statements that provide documentation are called

Front

Comments

Back

Envisioning program components as objects that are similar to concrete objects in the real world is the hallmark of ____

Front

Object-oriented programming

Back

Assuming a variable w has been assigned to the value 15, what does the following statement do? w == 5 ? x = 2 : x = 0;

Front

Assigns 2 to x

Back

Which assignment is correct in Java? Value = 2.12

Front

Double value = 2.12;

Back

Assuming a variable y has been assigned the value 6, the value of !(y<7) is ____.

Front

False

Back

In Java, what is the value of 3+7*4+2?

Front

33

Back

Which of the following is typically used in a flowchart to indicate a decision?

Front

Diamond

Back

Section 2

(40 cards)

Which of the following statements determines the square root of a number and assigns it to a variable s?

Front

s = Math.sqrt(number);

Back

The concept of allowing a class's private data to be changed only by a class's own methods is known as

Front

Information hiding

Back

A method is declared as public static void showResults (double d, int i). Which of the following is a correct method call?

Front

showResults(12.2, 67);

Back

A program or class that instantiates objects of another prewritten class is a(n)

Front

Class client

Back

You send messages or information to an object through its

Front

Methods

Back

The method with the declaration public static int aMethod(double d) has a method type of

Front

int

Back

Which of the following could be the last legally coded line of a method declared as public static int getVal(double sum)?

Front

return;

Back

When a block exists within another block, the blocks are

Front

Nested

Back

In Java, methods must include all of the following except ____.

Front

A declaration

Back

If you create a class that contains one method and instantiates two objects, you usually store ___ for use with the objects.

Front

One copy of the method

Back

Which of the following is a correct call to a method declared as a public static void aMethod(char code)

Front

aMethod('Q');

Back

Objects contain methods and data items, which are also known as

Front

Fields

Back

The method with the declaration public static char procedure(double d) has a method type of

Front

char

Back

A constructor ____ parameters

Front

Can receive

Back

Methods that you reference with individual objects are

Front

Nonstatic

Back

The code between a pair of curly braces in a method is a

Front

Block

Back

Variables that are shared by every instantiate of a class are

Front

Class variables

Back

A method variable ____ a class variable within the same name

Front

Override

Back

The portion of a program within which you can reference a variable is the variable's

Front

Scope

Back

The nonstatic data components of a class often are referred to as the ___ of that class

Front

Access types

Back

Java classes are stared in a folder or

Front

package

Back

If a class is named Student, the class constructors named is

Front

Student

Back

Usually, you want each instantiate of a class to have its own copy of ___

Front

The data fields

Back

The GregorianCalendar class get () method always return a(n)

Front

Integer

Back

If you declare a variable as an instance variable within a class and you declare and use the same variable name within a method of the class, then within the method

Front

The variable used inside the method takes precedence

Back

You can declare variables with the same name multiple times

Front

Within a method

Back

The this reference

Front

Can be used implicitly

Back

The body of a class is always written

Front

Between curly braces

Back

Suppose you declare an object as Book thisBook; Before you sore data in thisBook you

Front

Also must explicitly allocate memory for it

Back

Which of the following method declarations is correct for a static method named displayFacts() if the method receives an int argument?

Front

public static void displayFacts (int data)

Back

A constructor ____ overloaded

Front

Can be

Back

All method declaration contain

Front

Parenthesis

Back

A public static method named computeSum() is located in classA. to call the method from within ClassB, use the statement

Front

ClassA.computeSum();

Back

If a method is written to receive a double parameter, and you assign an integer to the method, then the method will

Front

Work correctly, the integer will be promoted to a double

Back

Non-ambiguous, overloaded methods must have the same

Front

Name

Back

Most class data fields are

Front

Private

Back

The method public boolean testValue (int reponse) returns

Front

A boolean value

Back

The keyword final used with a variable declaration indicates

Front

A symbolic constant

Back

A GregorianCalendar object can be created with one of the seven constructors. this means the constructors are

Front

Overloaded

Back

If you use the automatically supplied default constructor when you create an object

Front

Numeric fields are set to 0 (zero)

Back