• Home
  • Textbooks
  • Introduction to Programming with Java: A Problem Solving Approach
  • Object-Oriented Programming— Additional Details

Introduction to Programming with Java: A Problem Solving Approach

John S. Dean, Raymond H. Dean

Chapter 7

Object-Oriented Programming— Additional Details - all with Video Answers

Educators


Chapter Questions

02:05

Problem 1

The statement
Car car;
allocates space in memory for an object. (T / F)

Surjit Tewari
Surjit Tewari
Numerade Educator
03:33

Problem 2

What does the new operator do?

Mirza  Aslam Beig
Mirza Aslam Beig
Numerade Educator
01:33

Problem 3

Assigning one reference variable to another copies the right-side object's instance variables into the left-side object's instance variables. (T / F)

Gaurav Kalra
Gaurav Kalra
Numerade Educator
01:52

Problem 4

What is a memory leak?

Chloe A
Chloe A
Numerade Educator
01:36

Problem 5

Consider this code fragment:
boolean same;
\[
\begin{array}{l}
\text { Car } \operatorname{car} X=\text { new } \operatorname{Car}() ; \\
\text { Car } \operatorname{car} Y=\operatorname{car} X \\
\text { same }=(\operatorname{car} X==\operatorname{car} Y)
\end{array}
\] What is the final value of same?

Adithya Ramanujam
Adithya Ramanujam
Numerade Educator
00:32

Problem 6

What is the return type of an equals method?

Aditya Sood
Aditya Sood
Numerade Educator
03:41

Problem 7

By convention, we use the name equals for methods that perform a certain kind of evaluation. What is the difference between the evaluation performed by an equals method and the $==$ operator?

Joshua Fischbach
Joshua Fischbach
Numerade Educator
02:52

Problem 8

When you pass a reference to a method, you enable the method to modify the referenced object. (T / F)

Arin Asawa
Arin Asawa
Numerade Educator
02:01

Problem 9

What two things must be included in a method definition so that it may be called as part of a method call-chaining statement?

Adam Conner
Adam Conner
Numerade Educator
00:36

Problem 10

What is it called when you have two or more methods with the same name in the same class?

Sam Limsuwannarot
Sam Limsuwannarot
Numerade Educator
01:48

Problem 11

If you want the current object to call a different method in the same class as the current class, the method call is easy-just call the method directly, with no reference variable dot prefix. (T / F)

Foster Wisusik
Foster Wisusik
Numerade Educator
00:46

Problem 12

What is the return type of a constructor?

Arin Asawa
Arin Asawa
Numerade Educator
00:57

Problem 13

The name of a constructor must be exactly the same as the name of its class. (T / F)

Aditya Sood
Aditya Sood
Numerade Educator
01:39

Problem 14

Standard coding conventions suggest that you put constructor definitions after the definitions of all methods. (T / F)

Manik Pulyani
Manik Pulyani
Numerade Educator
02:06

Problem 15

If a class's source code contains a single one-parameter constructor, the constructor is overloaded because this one-parameter constructor has the same name as the default zero-parameter constructor. $(\mathrm{T} / \mathrm{F})$

Manik Pulyani
Manik Pulyani
Numerade Educator
01:11

Problem 16

Suppose you have a class with two constructors. What are the rules for calling one constructor from the other constructor?

Aditya Sood
Aditya Sood
Numerade Educator
00:55

Problem 17

You can partition a large problem into many smaller problems by using many driven classes. (T / F)

Aditya Sood
Aditya Sood
Numerade Educator
01:01

Problem 18

How do you give a component object a reference to its container or another component in the same container?

Jacob Shpiece
Jacob Shpiece
Numerade Educator
01:10

Problem 19

What do you do to make one object logically contain another object?

Melissa Munoz
Melissa Munoz
Numerade Educator