Question: import java.util.ListIterator; import java.util.LinkedList; public class Test { public static void main( String[] args ) { LinkedList a, b; a = new LinkedList(); b =

import java.util.ListIterator; import java.util.LinkedList;

public class Test {

public static void main( String[] args ) {

LinkedList a, b;

a = new LinkedList(); b = new LinkedList();

a.add( "alpha" ); a.add( "bravo" ); a.add( "tango" ); a.add( "charlie" );

ListIterator i, j;

i = a.listIterator(); j = b.listIterator();

while ( i.hasNext() ) { j.add( i.next() ); }

System.out.println( a ); System.out.println( b );

}

}

What is the result of the execution of the above Java program?

A. charlie, tango, bravo, alpha charlie, tango, bravo, alpha

B. alpha, bravo, tango, charlie alpha, bravo, tango, charlie

C. charlie, tango, bravo, alpha alpha, bravo, tango, charlie

D. alpha, bravo, tango, charlie charlie, tango, bravo, alpha

E. Runs into an infinite loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!