csc

Ace your homework & exams now with Quizwiz!

enum constants have a toString method.

True

When a method's return type is a class, what is actually returned to the calling program?

a reference to an object of that class

To retrieve text that a user has typed into a TextField control, you call the ________ method.

getText

Which of the following is the operator used to determine whether an object is an instance of a particular class?

instanceOf

A search algorithm ________.

is used to locate a specific item in a collection of data

Select all that apply. Which of the following are nodes that can be used in a scene graph?

leaf node root node branch node

The only limitation that static methods have is ________.

they cannot refer to nonstatic members of the class

In the following statement, which is the interface? public class ClassA extends ClassB implements ClassC

ClassC

If a[] and b[] are two integer arrays, the expression a == b compares the array contents.

False

If two methods in the same class have the same name but different signatures, the second overrides the first.

False

Inheritance involves a subclass, which is the general class, and a superclass, which is the specialized class.

False

Styles specified with the .root selector take precedence over styles applied to any other node.

False

The ________ layout container arranges its contents with columns and rows.

GridLayout

What does <String> specify in the following statement? ArrayList<String> nameList = new ArrayList<String>();

It specifies that only String objects may be stored in the ArrayList object.

If the following is from the method section of a UML diagram, which of the statements below is true? + add(object2:Stock) : Stock

This is a public method named add that accepts and returns references to objects in the Stock class.

A TextArea is a multiline TextField that can accept or display several lines of text.

True

A class is not an object. It is a description of an object

True

An enumerated data type is actually a special type of class.

True

The recursive binary search algorithm is a good example of repeatedly breaking a problem down into smaller pieces until it is solved.

True

The term "no-arg constructor" is applied to any constructor that does not accept arguments.

True

When a subclass extends a superclass, the public members of the superclass become public members of the subclass.

True

You cannot use the fully-qualified name of an enum constant for ________.

a case expression

A ragged array is ________.

a two-dimensional array where the rows have different numbers of columns

The following statement is an example of ________. import java.util.*;

a wildcard import statement

In a recursive program, the number of times a method calls itself is known as the ________.

depth of recursion

The key word this is the name of a reference variable that is available to all static methods.

False

When a splash screen is displayed, the application does not load and execute until the user clicks the splash screen image with the mouse.

False

It is not possible for a superclass to call a subclass's method.

True

Shadowing is the term used to describe where the field name is hidden by the name of a local or parameter variable.

True

Which of the following ArrayList class methods is used to insert an item at a specific location in an ArrayList?

add

Replacing inadequate superclass methods with more suitable subclass methods is known as ________.

method overriding

If a class contains an abstract method ________.

the method will only have a header, but not a body, and will end with a semicolon, the method cannot be overridden in subclasses, and you must create an instance of the class

What type of relationship exists between two objects when one object is a specialized version of another object?

"is a"

Which symbol indicates that a member is private a UML diagram?

-

When the user selects an item in a ListView, a change event occurs.

True

In memory, an array of String objects ________.

consists of an array of references to String objects

A declaration for an enumerated type begins with the ________ key word.

enum

If a method in a subclass has the same signature as a method in the superclass, the subclass method overrides the superclass method.

True

Instance methods do not have the key word static in their headers.

True

You can write a super statement that calls a superclass constructor but only in the subclass's constructor.

True

The sequential search algorithm ________.

uses a loop to sequentially step through an array, starting with the first element

The "has a" relationship is sometimes called a(n) ________ because one object is part of a greater whole.

whole-part relationship

Select all that apply. Which of the following statements is(are) true about this code? final int ARRAY_SIZE = 10; long[] array1 = new long[ARRAY_SIZE];

-It creates an instance of an array of ten long values. -It declares array1 to be a reference to an array of long values. -It will allow valid subscripts in the range of 0 through 9.

Which of the following creates a custom style class that will allow a Button control to appear with a blue background and yellow text?

.button-color { -fx- background-color: blue; -fx- text-fill: yellow;}

Subscripting always starts with ________.

0

Given the following code that uses recursion to find the factorial of a number, how many times will the else clause be executed if n = 5? private static int factorial(int n) { if (n == 0) return 1; else return n * factorial(n - 1); }

5

In the following code, which line in ClassA has an error? Line 1public interface MyInterface Line 2 { Line 3 int FIELDA = 55; Line 4 public int methodA(double); Line 5 } Line 6 public class ClassA implements MyInterface Line 7 { Line 8 FIELDA = 60; Line 9 public int methodA(double) { } Line 10 }

8

________ tells the Java compiler that a method is meant to override a method in the superclass.

@Override

If a subclass constructor does not explicitly call a superclass constructor, ________.

Java will automatically call the superclass's default or no-arg constructor just before the code in the subclass's constructor executes

What will be the result after the following code is executed? final int ARRAY_SIZE = 5; float[] x = float[ARRAY_SIZE]; for (i = 1; i <= ARRAY_SIZE; i++){ x[i] = 10.0; }

The code contains a syntax error and will not compile.

A single copy of a class's static field is shared by all instances of the class.

True

An abstract class is not instantiated itself but serves as a superclass for other classes.

True

To build a menu system you must ________.

create the Menu objects and register an event handler for each menu item object Add the MenuBar object to the scene graph create a MenuBar object

It is common practice to use a ________ variable as a size declarator.

final

Which of the following statements correctly adds a label to the first row and second column of a GridPane object?

gridpane.add(myLabel, 1, 0);

Which of the following import statements is required in order to create a BorderPane layout container?

import javafx.scene.layout.BorderPane;

To display an image in a JavaFX application you must ________.

include both the Image and the ImageView classes

A class that is defined inside another class is called a(n) ________.

inner class

Another term for an object of a class is a(n) ________.

instance

When a field is declared static there will be ________.

only one copy of the field in memory

A subclass can directly access ________.

only public and protected members of the superclass

The actions performed by the JVM that take place with each method call are sometimes referred to as ________.

overhead

Which of the following statements creates a Slider with a range of 1 to 20 with a starting value of 1?

Slider slider = new Slider(1.0, 20.0, 1.0);

Which of the following statements creates an empty TextArea?

TextArea textArea = new TextArea();

To use recursion for a binary search, what is required before the search can proceed?

The array must be sorted.

Which of the following statements will allow a user to type input into a field of a ComboBox named myComboBox?

myComboBox.setEditable(true);

If two methods have the same name but different signatures they are ________.

overloaded

Which of the following statements declares Salaried as a subclass of PayType?

public class Salaried extends PayType

In the ________, the problem must be reduced to a smaller version of the original problem.

recursive case

An object's ________ is simply the data that is stored in the object's fields at any given moment.

state

Instance methods do not have the ________ key word in their headers.

static

To indicate the data type of a variable in a UML diagram, you enter ________.

the variable name followed by a colon and the data type


Related study sets

5.3.11 Practice Questions Test out

View Set

Unit exam #3: 45, 47, 41, 44, 48, 49

View Set

Individual Income Tax Computation Chapter 8

View Set

La gestion des carrières dans les organisations

View Set

Macro Inter chap 3: National Income: Where It Comes From and Where It Go

View Set