Question: Assume the following declarations. public interface ListInterface interface public void add( T n ); public void add( int newPosition, T n ); public void

Assume the following declarations. public interface ListInterface interface public void add( T n ); public void add( int newPosition, T n ); public void replace( int givenPosition, T n ); public Object getEntry( T givenPosition ); and that the following statements have been executed: ListInterface list0 = new ArrayList (; Tell what will be displayed by the code segment. (list starts at position zero) list0. add ( 3, 21 ); // three-th position in list; list0. add ( 7, 17 ); // seven-th position in list; list0.replace ( 3, list0.getEntry( 7 ) ); System.cut.println( list0.getEntry( 3 ) +"" + list0.getEntry( 7 ) ); O 17 17 O 21 17 O run-time error O 21 Oxfffffff (some hex address)
Step by Step Solution
3.38 Rating (148 Votes )
There are 3 Steps involved in it
Solution The answer ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
635fa19edaef8_232946.pdf
180 KBs PDF File
635fa19edaef8_232946.docx
120 KBs Word File
