Exam 4: More Object Concepts

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What are the three methods that enable you to incorporate prewritten classes with your programs?

Free
(Essay)
4.8/5
(34)
Correct Answer:
Verified

Use the entire path with the class name.
Import the class.
Import the package that contains the class you are using.

When you pass a(n) ____________________, you pass a memory address.

Free
(Short Answer)
4.8/5
(35)
Correct Answer:
Verified

reference

What does it mean when a variable overrides another variable? Describe the process of declaring variables in methods and memory locations.

Free
(Essay)
4.9/5
(43)
Correct Answer:
Verified

While you cannot declare a variable twice in the same block, you can declare variables in a method of a class and use that same variable name within other methods of the class. The variable that is declared inside each method takes its own computer memory locations. Therefore, when you use the variable's name in the method where it is declared, it will override other variables with the same name in another method. A locally declared variable will hide another variable with the same name elsewhere in the class.

What is the difference between class variables and instance variables?

(Essay)
4.8/5
(31)

A block can exist entirely within another block or entirely outside and separate from another block, and sometimes blocks can overlap.

(True/False)
4.8/5
(26)

As long as you do not make any ambiguous method calls, a program that contains a potentially ambiguous situation will execute correctly.

(True/False)
4.8/5
(43)

Match each term with the correct statement below. -Using one term to indicate diverse meanings

(Multiple Choice)
4.8/5
(35)

Declare a GregorianCalendar object named year. Use the GregorianCalendar class and the get() method to display the current year in a println statement.

(Essay)
4.9/5
(37)

Match each term with the correct statement below. -Useful when working with dates and times

(Multiple Choice)
4.9/5
(47)

Match each term with the correct statement below. -Defines mathematical constants such as PI

(Multiple Choice)
4.8/5
(42)

If an integer is passed to a method with a double parameter, the double is promoted to an integer.

(True/False)
4.7/5
(34)

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

(Multiple Choice)
4.7/5
(36)

Within any class or method, the code between a pair of curly braces is called a(n) ____.

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.9/5
(32)

When you write your own constructors, you cannot write versions that receive parameters.

(True/False)
4.8/5
(37)

In a Java ____________________ statement, you use a wildcard symbol to represent all the classes in a package.

(Short Answer)
4.9/5
(35)

When you properly ____ a method, you can call it providing different argument lists, and the appropriate version of the method executes.

(Multiple Choice)
4.8/5
(38)

A(n) ____________________ begins immediately after the method declaration and ends at the end of the method.

(Short Answer)
4.9/5
(37)

Due to automatic type promotion, when a method with a double parameter is passed an integer, the integer will be promoted to a(n) ____.

(Multiple Choice)
4.8/5
(39)

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

(Multiple Choice)
4.8/5
(32)
Showing 1 - 20 of 67
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)