Given this class: And given this main method, located in another class: Which three pieces of code, when inserted independently, set the value of amount to 100? (Choose three.) A. B. C. D. E. F.
Answer is ADE.
To test, uncomment each option separately.
public class CheckingAccount {
public int amount;
/* line n1 - Option A
public CheckingAccount() { // Constructor
amount = 100;
}
*/
/* line n1 - Option D
public CheckingAccount() { // Constructor
this.amount = 100;
}
*/
public static void main(String[] args) {
CheckingAccount acct = new CheckingAccount();
/* line n2 - Option E */
//acct.amount = 100;
System.out.println(acct.amount);
} // fim da classe main
}// fim da classe CheckingAccount
This section is not available anymore. Please use the main Exam Page.1z0-808 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
TheeOne
1 month, 4 weeks agoMPignaProTech
6 months agonamaoo
1 year, 7 months agoIbrahimAlnutayfi
1 year, 9 months agoakbiyik
2 years, 4 months agocarloswork
2 years, 5 months agoiSnover
2 years, 6 months agoshivkumarx
2 years, 7 months ago