Question: 3. list1 is an arraylist which stores String information. What will be the output of the following code segment? listi.add(Anaya); listi.add(Layla); listi.add(Sharrie); listi.set(0, Destini); listi.add(0,


!["Destini"); listi.add(0, "Sarah"); System.out.println(listi); a) a) ["Sarah", "Destini", "Anaya", "Layla", "Sharrie"] b)](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f506c9c41db_08966f506c967cb9.jpg)
![O ["Sarah", "Layla", "Sharrie"] c) O ["Sarah", "Destini", "Layla", "Sharrie"] d) ["Destini",](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f506ca4fbdd_08966f506c9f02d5.jpg)
3. list1 is an arraylist which stores String information. What will be the output of the following code segment? listi.add("Anaya"); listi.add("Layla"); listi.add("Sharrie"); listi.set(0, "Destini"); listi.add(0, "Sarah"); System.out.println(listi); a) a) ["Sarah", "Destini", "Anaya", "Layla", "Sharrie"] b) O ["Sarah", "Layla", "Sharrie"] c) O ["Sarah", "Destini", "Layla", "Sharrie"] d) ["Destini", "Layla", "Sharrie", "Sarah"] 13- The special syntax for invoking a constructor of the super class is a) O super) ( b) parent() c) O child() d) base() 0209921 14- Examine the following code. There are two classes: Page and Book. Which best describes their relationship? Page page =new Page(); Book book=new Book (page); a) b) Page inherits from Book Page HAS-A Book This code is invalid Book HAS-A Page d) 15- Inheritance is used when the relationship between two classes is aan). relationship. a) inverse PART-OF-A b) IS-A HAS-A d) 1020992 Bo brak
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
