Filters
Question type

Study Flashcards

The activities of the development cycle are generally thought to


A) be strictly linear
B) be rigidly ordered
C) overlap
D) have optional steps
E) both A and B are True

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

In order to implement Comparable in a class, what method(s) must be defined in that class?


A) equals
B) compares
C) both lessThan and greaterThan
D) compareTo
E) both compares and equals

F) D) and E)
G) B) and D)

Correct Answer

verifed

verified

Provide a reason why a method would be declared static.

Correct Answer

verifed

verified

A method is declared static if it might ...

View Answer

The most important decisions regarding the development of a system are made during the implementation phase while code is actively being written.

A) True
B) False

Correct Answer

verifed

verified

During program development, software requirements specify


A) how the program will accomplish the task
B) what the task is that the program must perform
C) how to divide the task into subtasks
D) how to test the program when it is done
E) all of the above

F) None of the above
G) B) and C)

Correct Answer

verifed

verified

In which phase of program development would you expect the programmer(s) to create the pseudocode?


A) Software requirements
B) Software design
C) Software implementation
D) Software testing
E) Could occur in any of the above

F) C) and D)
G) A) and C)

Correct Answer

verifed

verified

For the questions below, consider a class called ChessPiece. This class has two instance data, String type and int player. The variable type will store "King", "Queen", "Bishop", etc and the int player will store 0 or 1 depending on whose piece it is. We wish to implement Comparable for the ChessPiece class. Assume that, the current ChessPiece is compared to a ChessPiece passed as a parameter. Pieces are ordered as follows: "Pawn" is a lesser piece to a "Knight" and a "Bishop", "Knight" and "Bishop" are equivalent for this example, both are lesser pieces to a "Rook" which is a lesser piece to a "Queen" which is a lesser piece to a "King." -Which of the following would not be considered an algorithm?


A) a recipe
B) a computer program
C) pseudocode
D) a shopping list
E) travel directions

F) A) and D)
G) A) and E)

Correct Answer

verifed

verified

The idea of having programmers and developers meet in order to critique a software design or implementation is known as


A) an interview
B) a walkthrough
C) prototyping
D) aggregation
E) evolutionary development

F) All of the above
G) B) and D)

Correct Answer

verifed

verified

To implement Comparable for the ChessPiece class, the current ChessPiece's type is compared to a ChessPiece passed as a parameter. The method should return 0 if the types are equal, -1 if this piece's type is a lesser piece than the parameter's type, and 1 if this piece's type is a greater piece than the parameter's type. Pieces are ordered as follows: "Pawn" is a lesser piece to a "Knight" and a "Bishop", "Knight" and "Bishop" are equivalent for this example, both are lesser pieces to a "Rook" which is a lesser piece to a "Queen" which is a lesser piece to a "King." Write the proper method to implement Comparable for this class.

Correct Answer

verifed

verified

public int compareTo(ChessPiece a)
{
if ...

View Answer

Formal parameters are those that appear in the method call and actual parameters are those that appear in the method header.

A) True
B) False

Correct Answer

verifed

verified

All parts of a container in BorderLayout must be used.

A) True
B) False

Correct Answer

verifed

verified

Having multiple class methods of the same name where each method has a different number of or type of parameters is known as


A) encapsulation
B) information hiding
C) tokenizing
D) importing
E) method overloading

F) None of the above
G) A) and E)

Correct Answer

verifed

verified

Which of the following methods is a static method? The class in which the method is defined is given in parentheses following the method name.


A) equals (String)
B) toUpperCase (String)
C) sqrt (Math)
D) format (DecimalFormat)
E) paint (Applet)

F) C) and E)
G) C) and D)

Correct Answer

verifed

verified

Write a set of code that will allow a user to select an input image and then place this image in a JLabel lab1 and add lab1 to a JPanel as the northern component in a JFrame using BorderLayout. The JFrame has already been instantiated as jf and the BorderLayout already established. Hint: a JFileChooser returns a File and JLabel requires the String name of a file as an argument. A File can return its name using File class' method getAbsolutePath( )

Correct Answer

verifed

verified

JFileChooser jfc = new JFileChooser( );
...

View Answer

The idea that an object can exist separate from the executing program that creates it is called


A) transience
B) static
C) persistence
D) serialization
E) finality

F) A) and E)
G) C) and E)

Correct Answer

verifed

verified

In order to create a constant, you would use which of the following Java reserved words?


A) private
B) static
C) int
D) final
E) class

F) C) and D)
G) A) and B)

Correct Answer

verifed

verified

Showing 61 - 76 of 76

Related Exams

Show Answer