Random
Vocab
Vocab pt.2
Functions
Practice
100

This marks the beginning of a multiline comment.

/*

100

What is used for writing output to a file?

PrintWriter

100

This term us used to describe variables that keep a running total of something.

Accumulating

100

What is an example of an escape sequence?

/n

100

if( firstletter != 'y' || firstletter != 'Y') System.out.println ( "ok" );

What happens?

ok will always be printed

200

Explain how = is different than ==.

= is a Simple assignment operator while == is Equal to.

200

What is used when getting input from a file?

scanner

200

A(n) _____ is a named storage location in a computer's memory.

Variable

200

What does not change the value of a variable?

count == 1

200

Suppose you implement a class with the header
// public class TestQuestion
The java source code for the class is stored in a file with the name:

TestQuestion.java

300

______ is used in a class definition when establishing an is-a relationship.

Extends

300

A(n) ______ is a value like 'A' or 72 that is written into the code of a program.

Literal

300

This term describes a loop that appears inside another loop.

Nested Loop

300

What should you use to compute the value that results when raising one variable to the power of another (i.e, exponentiation)?

Math.pow

300

How many times will the body of the loop execute?
for (int i = 1; i < 20, i++)
{
System.out.println ( i )
}

19

400

_____ must be used somewhere in the definition of a value-returning method.

Return

400

A(n) _______ is a kind of type conversion which causes an error because information may be lost.

Narrowing Conversion

400


This is a keyword used when declaring a variable which cannot be changed.

Final

400

What should you typically use if you want to continue asking the user to enter a value whenever they type a invalid input?

While

400

What is the term 9 in the following line of code?
int [] myArr = new int [9];

Size Declarator

500

The last subscript in an array list is always what?

1 less than the number of elements

500

What is the difference between a declaration and an assignment? Give examples.

A declaration opens up a space for a value in the computer's memory and an assignment fills it with a value.
Declaration: Int Example;
Assignment: Example = #;

500

The term we use when we have two methods in the same class with the same name but different parameters is ________.

Overloading

500

When is the use of a cast operation necessary?

When your Java class doesn't have the right data type for what you need.

500

How many times will the body of the loop execute?
for (int i = 1; i < 10, i++)
{
System.out.println ( i )
}

9

M
e
n
u