Question: 20 easy quick java questions! Thanks for the help!! 1. The code between a pair of curly braces in a method is a ____. a.

20 easy quick java questions! Thanks for the help!!

1.

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

a. function
b. block
c. brick

d. sector

2.

When a block exists within another block, the blocks are ____.

a. structured
b. illegal
c. nested

d. sheltered

3.

In Java, ____ means writing multiple methods in the same scope that have the same name but different parameter lists.

a. inheriting
b. reconditioning
c. scoping

d. overloading

4.

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

a. constructor
b. header
c. scope

d. signature

5.

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 ____.

a. the class instance variable takes precedence
b. the variable used inside the method takes precedence
c. the two variables refer to a single memory address

d. an error will occur

6.

If a class's only constructor requires an argument, you ____ for every object of the class that you create.

a. do not need to provide an argument
b. inherit the default data values
c. must provide an argument

d. must create constructors

7.

Nonambiguous, overloaded methods must have the same ____.

a. number of parameters
b. types of parameter
c. name

d. parameter names

8.

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

a. work correctly; the integer will be promoted to a double
b. work correctly; the integer will remain an integer
c. not work; an error message will be issued

d. execute, but any output will be incorrect

9.

A constructor ____ parameters.

a. can receive
b. can receive a maximum of 10
c. must receive

d. cannot receive

10.

A constructor ____ overloaded.

a. can be
b. must be
c. cannot be

d. is always automatically

11.

The ____ package is implicitly imported into every program you write.

a. java.time
b. java.util
c. java.math

d. java.lang

12.

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

a. two different methods containing two different this references
b. one copy of the method
c. two copies of the method

d. data only (the methods are not stored)

13.

The reference to an object that is passed to any object's nonstatic method is called the ____.

a. implicit reference
b. this reference
c. object alias

d. object signature

14.

Methods that do not have a this reference because they have no object associated with them are called ____ methods.

a. class
b. private
c. nonstatic

d. parent

15.

Variables that are shared by every instantiation of a class are ____.

a. illegal
b. class variables
c. public variables

d. private variables

16.

A(n) ____ is a data type that consists of a list of values.

a. constant
b. enumeration
c. composition

d. accumulation

17.

Java classes are stored in a folder or ____.

a. bundle
b. package
c. database

d. packet

18.

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

a. s = Math.sqrt(number);
b. s = sqrt(number);
c. number = Math.sqrt(s);

d. number = sqrt(s);

19.

____ describes the relationship between classes when an object of one class is a data field within another class.

a. Relational
b. Inheritance
c. Composition

d. Ambiguity

20.

Which of the following is not a type of nested class?

a. ambiguous
b. local
c. anonymous
d. inner

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!