Which of the following are legal assignments? List the statement number. 1. Book
ID: 3871923 • Letter: W
Question
Which of the following are legal assignments? List the statement number.
1. Book b = new Book();
2. Book b = new Dictionary();
3. Book b = new eBook();
4. eBook b = new Book();
5. eBook b = new Dictionary();
6. eBook b = new eBook();
7. Dictionary b = new Book();
8. Dictionary b = new Dictionary();
9. Dictionary b = new eBook();
10. Object b = new Book();
11. Object b = new Dictionary();
12. Object b = new eBook();
13. Book b = new Object();
14. Dictionary b = new Object();
15. eBook b = new Object();
Explanation / Answer
Which of the following are legal assignments? List the statement number.
Answer:
1. Book b = new Book();
6. eBook b = new eBook();
8. Dictionary b = new Dictionary();
10. Object b = new Book();
11. Object b = new Dictionary();
12. Object b = new eBook();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.