18. Show the output of the following program: import cho 6 ists.\" public class
ID: 3803200 • Letter: 1
Question
18. Show the output of the following program: import cho 6 ists." public class List Exer public statio void main Stri ng args) Lis Interface String list new Array Unsorted Lis: Strir.E list .add apple list add ("peach" list 1. add ("orange" liat add pea list 1 remove peach" List Interface String list new Array Sorted List String list 2. add ("apple") iist2.acd "paaeh") list add ("orange" lis 2. add ("pear") list remove "peach") Indexed Listinterface String 1ist3 new ArrayIndexedl ist String list 3. add (C. "apple") add (0. peach lis list 3 add (1. orange") ist add co. "pear" 1 at adc (2. "Plum" 3. lis 3. emcve peach system. out print Unsorted system 01 t.print n ist 1) system. out print ("Sorted") systen.. out.println (-latz) system. out print ("Indexed") system out println (1 st 3)Explanation / Answer
there is no interface like ListInterface in java
and neither there is any class like ArrayunsortedList, ArraySortedList or ArrayIndexedList in java
so the above code will give error while executing it in any Java IDE.
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.