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

Introduction to Programming with Java: A Problem Solving Approach

John S. Dean, Raymond H. Dean

Chapter 6

Object-Oriented Programming - all with Video Answers

Educators


Chapter Questions

00:29

Problem 1

A class is an instance of an object. (T / F)

Ernest Castorena
Ernest Castorena
Numerade Educator
00:55

Problem 2

How many objects may there be within a single class?

Aditya Sood
Aditya Sood
Numerade Educator
01:48

Problem 3

A class's instance variables must be declared outside of all ________, and all instance variable declarations should be located at the _______.

Foster Wisusik
Foster Wisusik
Numerade Educator
01:18

Problem 4

Methods accessible from outside a class are public, but instance variables (even those that an outsider may need to change or read) are usually private. Why?

Jennifer Stoner
Jennifer Stoner
Numerade Educator
03:07

Problem 5

Where does main go-in the driver class or in one of the driven classes?

SS
Sarvesh Somasundaram
Numerade Educator
01:55

Problem 6

When a program has both driver and driven classes, where should most of the program code reside?

Adam Conner
Adam Conner
Numerade Educator
01:18

Problem 7

How do you retrieve a private instance variable's value from within a main method?

Jennifer Stoner
Jennifer Stoner
Numerade Educator
00:42

Problem 8

A reference variable holds the ________ of an object.

Kaylee Mcclellan
Kaylee Mcclellan
Numerade Educator
02:51

Problem 9

An instance method might contain a statement like this.weight $=1.0 ;$ but if that method's class currently has five instantiated objects, there are five different variables called weight. How can we determine which one is getting the new value?

Prabhu Ramji
Prabhu Ramji
Numerade Educator
01:36

Problem 10

What are the default values for int, double, and boolean for an object's instance variables?

Adithya Ramanujam
Adithya Ramanujam
Numerade Educator
06:02

Problem 11

In the Mouse program of Figures 6.4 and $6.5,$ what is the persistence of gus's age variable?

Linh Vu
Linh Vu
Numerade Educator
01:47

Problem 12

After a program is written, a UML class diagram provides a brief outline of each class in the program. It helps other people see what methods are available and what arguments they need. Give some reasons why it might be helpful to have an already created class diagram in front of you while you are implementing the class and writing its methods.

Jennifer Stoner
Jennifer Stoner
Numerade Educator
03:07

Problem 13

Assume the main method in Mouse2Driver had started more simply with only Mouse mickey; What would be the value of mickey immediately after this statement?

SS
Sarvesh Somasundaram
Numerade Educator
01:42

Problem 14

Usually, the use of multiple return statements leads to code that is more understandable. (T / $\mathrm{F}$ )

Nick Johnson
Nick Johnson
Numerade Educator
08:07

Problem 15

How is a method parameter like a local variable, and how do they differ?

Willis James
Willis James
Numerade Educator
08:07

Problem 16

What is the relationship and difference between a method argument and a method parameter?

Willis James
Willis James
Numerade Educator
01:15

Problem 17

What is the standard prefix for an accessor method?

Adam Conner
Adam Conner
Numerade Educator
00:14

Problem 18

What is the standard prefix for a mutator method?

Erika Bustos
Erika Bustos
Numerade Educator
01:13

Problem 19

What is the standard prefix for a Boolean method?

Varsha Aggarwal
Varsha Aggarwal
Numerade Educator
01:13

Problem 20

Identify two general ways to reduce the size of the error in a simulation. For a given accuracy, which way is more efficient?

Mirza  Aslam Beig
Mirza Aslam Beig
Numerade Educator