BASED ON THE FOLLOWING JAVA CODE ANSWERS THE QUESTIONS BELOW. QUESTION 6 Which o
ID: 3733383 • Letter: B
Question
BASED ON THE FOLLOWING JAVA CODE ANSWERS THE QUESTIONS BELOW.
QUESTION 6
Which of the following provide the behavior of an Account object?
balance
name
acctNum
initBal
owner
number
withdraw
amtToTake
deposit
amtToAdd
getBalance
toString
s
Account objects have no behavior
QUESTION 7
Account.java Which of the following comprise the state of an Account object?
balance
name
acctNum
initBal
owner
number
withdraw
amtToTake
deposit
amtToAdd
getBalance
toString
s
Account objects have no state
QUESTION 8
Account.java Which of the following are members of the class Account?
balance
name
acctNum
initBal
owner
number
withdraw
amtToTake
deposit
amtToAdd
getBalance
toString
s
The Account class has no members.
QUESTION 9
Account.java Which of the following are accessors?
balance
name
acctNum
initBal
owner
number
withdraw
amtToTake
deposit
amtToAdd
getBalance
toString
s
There are no accessors
QUESTION 10
Account.java Which of the following are mutators?
balance
name
acctNum
initBal
owner
number
withdraw
amtToTake
deposit
amtToAdd
getBalance
toString
s
There are no mutators
balance
name
acctNum
initBal
owner
number
withdraw
amtToTake
deposit
amtToAdd
getBalance
toString
s
Account objects have no behavior
Explanation / Answer
Question 6 : withdraw, deposit, getBalance, toString
Behaviour of an object is defined by the operations/actions(Methods) that it can perform.
Question 7: balance, name, acctNum
State of an object is defined by the properties/attributes(Member variables) of it.
Question 8: balance, name, acctNum, withdraw, deposit, getBalance, toString
Class members include Member variables, Methods, constructors, Inner classes, Static/Instance blocks
Question 9: getBalance
Accessors are getters which returns private member variable.
Question 10: There are no mutators
Mutator is a method which is used to control the changes to a variables which is known as setter.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.