Interfaces andInheritance 2. (8 points) Given the following Java code fragment L
ID: 3748733 • Letter: I
Question
Interfaces andInheritance 2. (8 points) Given the following Java code fragment List targetList -new ArrayList); List other-new ArrayList(); List scores - new LinkedList (); new LinkedList(); LinkedList ArrayList names exile; State if each of the following lines of code compile without syntax error. Circle the appropriate answer (a) (b) exile - new List); (c) targetList = other ; (d) targetList - scores; (e) other - new List); (f) scores = exile; (g) (h) exile- targetList ; exile A. Yes B. No scores; A. Yes B. No A. Yes B. No A. Yes B. No A. Yes B. No A. Yes B. No scores A, Yes B.No = new ArrayList(); A. Yes B. No 3. (4 points) Identify any four methods every class in Java inherits from the Object super-classExplanation / Answer
Answer A;
Yes, it will worl
Answer B:
No, it will give error,we cant create object for List
Answer C:
No, Type missmatch error
Answer D:
Yes, it will work both same type
Answer E:
No, it will give error,we cant create object for List
Answer F:
Yes, it will work
Answer G:
Yes it will work
Answer F:
it will work, as both are same types
Answer 3:
equals()
hashCode()
toString()
wait()
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.