Question
QUESTION 1 Chapter 7. Question 1. Which of the following means the same as object ? a. class b. field c. instance d. category 0.5
QUESTION 1
Chapter 7. Question 1. Which of the following means the same as object?
a. | class | |
b. | field | |
c. | instance | |
d. | category |
0.5 points
QUESTION 2
Chapter 7. Question 2. Which of the following means the same as instance variable?
a. | field | |
b. | instance | |
c. | category | |
d. | class |
0.5 points
QUESTION 3
Chapter 7. Question 7. Which of the following is the most likely scenario for a specific class?
a. | Its data fields are private and its methods are public. | |
b. | Its data fields are public and its methods are private. | |
c. | Its data fields and methods are both public. | |
d. | Its data fields and methods are both private. |
0.5 points
QUESTION 4
Chapter 7. Question 8. Assume that you have created a class named Dog that contains a data field named weight and an instance method named setWeight(). Further assume that the setWeight() method is public and accepts a numeric parameter named pounds. Which of the following statements correctly sets a Dogs weight within the setWeight() method?
a. | pounds = weight | |
b. | weight = pounds | |
c. | either of these | |
d. | none of these |
0.5 points
QUESTION 5
Which method is automatically called when a Java object is instantiated?
a. | Constructor | |
b. | Accessor | |
c. | Mutator | |
d. | Utility |
0.5 points
QUESTION 6
A Java object can be a field in another Java object.
a. | True | |
b. | False |
0.5 points
QUESTION 7
Which of the following pairs is an example of an is-a relationship?
a. | Computer, Disk | |
b. | Apple, Orange | |
c. | Laptop, Computer | |
d. | Car, Engine |
0.5 points
QUESTION 8
Which Java statement is used to declare a class Triangle that is derived from class Shape?
a. | public class Triangle implements Shape | |
b. | public class Triangle extends Shape | |
c. | public class Triangle is-a Shape | |
d. | public class Triangle |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started