Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The order of the conditional expressions in the following is most important with

ID: 3691436 • Letter: T

Question

The order of the conditional expressions in the following is most important within a(n) ____ loop.
  while(requestedNum > LIMIT || requestedNum < 0)…

posttest

indefinite

nested

pretest

10 points   

QUESTION 2

public class First
{
   public static void main(String[] args)
   {
      System.out.println(“First Java application”);
   }
}

Given the above code, which item identifies the name of the class?

static

First

void

public

10 points   

QUESTION 3

When you create a block, you must place multiple statements within it.

True

False

10 points   

QUESTION 4

Both Rectangle2D.Float and Rectangle2D.Double can be created using four arguments representing the x-coordinate, y-coordinate, width, and height.

True

False

10 points   

QUESTION 5

You define the text to be displayed in a tool tip by using the setToolTipText() method and passing an appropriate ____ to it.

String

Integer

Boolean

Date

10 points   

QUESTION 6

You cannot declare a class to be final.

True

False

10 points   

QUESTION 7

Line comments start with ____.

a forward slash and two asterisks

a percent sign

a forward slash and an asterisk

two forward slashes

10 points   

QUESTION 8

The ____ method creates a solid arc.

drawArc()

fillArc()

clearArc()

solidArc()

10 points   

QUESTION 9

You can use the keyword _______ within a method in a derived class to access an overridden method in a base class.

this

super

sub

protected

10 points   

QUESTION 10

The ____ statement is useful when you need to test a single variable against a series of exact integer, character, or string values.

break

else

switch

if

10 points   

QUESTION 11

The length ____ contains the number of elements in the array.

area

box

block

field

10 points   

QUESTION 12

When you issue the command to compile a class containing errors, the Java compiler does not produce any error messages. You will first need to run the class in order to see error messages.

True

False

10 points   

QUESTION 13

When an application is run, the method that must be executed first must be named ____.

main()

first()

final()

void()

10 points   

QUESTION 14

By convention, a class diagram contains the ____ following each attribute or method.

class

data field

data type

argument

10 points   

QUESTION 15

You can tell that the equals() method takes a ____ argument because parentheses are used in the method call.

Null

Boolean

Double

String

10 points   

QUESTION 16

Usually, the subclass constructor only needs to initialize the ____ that are specific to the subclass.

methods

data fields

constructors

objects

10 points   

QUESTION 17

You can instruct a Graphics object to use a font by inserting the font as the argument in a ____ method.

setCharacters()

drawString()

setColor()

setFont()

10 points   

QUESTION 18

When constructing a Font object, which of the following arguments is NOT required?

weight

style

point size

typeface

10 points   

QUESTION 19

When they have the same name, variables within ____ of a class override the class’s fields.

methods

fields

statements

packages

10 points   

QUESTION 20

You must use the Java interpreter to translate the bytecode into executable statements before running a Java application.

True

False

10 points   

QUESTION 21

Strings and other objects that can’t be changed are known as ____.

accessor methods

string constants

immutable

garbage

10 points   

QUESTION 22

When mathematicians use a two-dimensional array, they often call it a ____.

matrix

mesh

net

grid

10 points   

QUESTION 23

Which of the following statements will change the value displayed in a JLabel named hello?

hello = setText("Hello");

hello.setText("Hello");

setText.hello = "Hello"

setText = hello

10 points   

QUESTION 24

Which of the following is NOT an initial value assigned to an object’s data field by a default constructor?

Boolean fields set to true

character fields set to Unicode ‘u0000’

numeric fields set to 0

a field of object references set to null

10 points   

QUESTION 25

A variable can hold more than one value at a time.

True

False

10 points   

QUESTION 26

____ is the amount of space between the bottom of the descent of one line and the top of the characters in the successive line of type.

Descent

Leading

Ascent

Height of a line

10 points   

QUESTION 27

The simplest statement you can use to make a decision is the ____ statement.

if

Boolean

true false

this

10 points   

QUESTION 28

You use the NOT operator, which is written as the exclamation point (!), to negate the result of any Boolean expression.

True

False

10 points   

QUESTION 29

When you place a component on the screen, the vertical position is the x-axis and the horizontal position is the y-axis.

True

False

10 points   

QUESTION 30

The statements pen.drawLine(50, 50, 100, 200); and pen.drawLine(100, 200, 50, 50); will both draw straight lines that slant down and to the right.

True

False

10 points   

QUESTION 31

A literal string is a(n) ____ object.

class

named

anonymous

lost

10 points   

QUESTION 32

You can overload methods correctly by providing different parameter lists for methods with the same name.

True

False

10 points   

QUESTION 33

When you perform a ____, you compare a value to the endpoints of numerical ranges to find the category in which a value belongs.

range match

sort

search

reference

10 points   

QUESTION 34

When you overload a Java method, you write multiple methods with a shared name.

True

False

10 points   

QUESTION 35

What is the default layout manager for JFrame?

BorderLayout

GridLayout

FlowLayout

FrameLayout

10 points   

QUESTION 36

When you want to increase a variable’s value by exactly 1, use the ____.

prefix increment operator

accumulating operator

power statement

binary operators

10 points   

QUESTION 37

An indefinite loop is a(n) ____ loop.

validating

event-controlled

counter-controlled

initialized

10 points   

QUESTION 38

In a ____ environment, you can change directories using the cd command. For example, to change to a directory named MyClasses, you type cd MyClasses and press Enter.

DOS

Windows

graphical

Java

10 points   

QUESTION 39

When any primitive type variable is passed to a method, the _____ is passed.

memory

reference

location

value

10 points   

QUESTION 40

____ is a calculated number that is used to uniquely identify an object.

Implicit conversion

Method binding

Ad-hoc polymorphism

A hash code

10 points   

QUESTION 41

Computers contain switches that are set to on or off.

True

False

10 points   

QUESTION 42

When you create a class and do not provide a(n) ____, Java automatically supplies you with a default one.

name

constructor

header

argument

10 points   

QUESTION 43

A class diagram consists of a rectangle divided into three sections.

True

False

10 points   

QUESTION 44

Which of the following is NOT a method of the KeyListener interface?

keyReleased()

keyClicked()

keyTyped()

keyPressed()

10 points   

QUESTION 45

The byte and short data types occupy less memory and can hold only smaller values.

True

False

10 points   

QUESTION 46

When creating arrays, Java is limited in size due to limitations on the number of variables and subscripts used.

True

False

10 points   

QUESTION 47

The term ____ refers to the mathematical accuracy of a value.

float data

real integers

single-precision floating-point number

significant digits

10 points   

QUESTION 48

A method can receive ____ arguments, even if it is defined as needing double arguments.

string

send

constructor

integer

10 points   

QUESTION 49

____ refers to the order in which values are used with operators.

Declaration

Floating

Associativity

Initialization

10 points   

QUESTION 50

The compiler determines which version of a method to call by the method’s ____.

signature

output

constructor

name

a.

posttest

b.

indefinite

c.

nested

d.

pretest

Explanation / Answer

1) D

2) D

3) True

5) A

6) False

7) D

8) A

9) B

10) C

11) D

12) False

13) A

14) A

15) B

16) D

19) A

20) True

21) C

22) A

24) A

25) False

26) D

27) A

28) True

29) False

31) C

32) True

33) B

34) True

35) A

36) A

38) A

39) B

40) D

41) True

42) B i.e constructor

43) True. Because a class diagram consists of rectangle divided into three parts that show name, data and methods of a class.

44) B ie key clicked()

47) float data

49) option C ie Associativity

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote