Solved

You Have Created a Coin Class and a Purse Class

Question 5

Multiple Choice

You have created a Coin class and a Purse class. Which of the following methods will correctly add a Coin object to an array list named coins in the Purse class?


A) public void add(Coin aCoin)
{
Coins.add(new Coin(aCoin) ) ;
}
B) public void add(Coin aCoin)
{
Coins.add(aCoin) ;
}
C) public void add(Coin aCoin)
{
Coins.addItem(new Coin(aCoin) ) ;
}
D) public void add(Coin aCoin)
{
Coins.addItem(aCoin) ;
}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions