Menu

Use Java Programming Following Questions Solutions Ready Within Today Jan 3 2020 8 00pm Gm Q43785334

Use java programming for the following questions to have thesolutions ready within today Jan 3 2020 at or before 8:00PM GMT+8time zone:

Question 10

  1. Declare a local String variable id and initialize it with your8-digit student ID in string form. What is the output of thefollowing program segment?

String str = id + “”; // two spaces System.out.println(str.indexOf(“5″) + ” + ” +str.substring(0,2) + “n”

+ str.trim().substring(5)+ “#”);

  1. The class List below is in java.util. What is the output of thefollowing program segment?

List<String> aList = newVector<>();

aList.add(“one”);

aList.add(“two”);

aList.add(“three”);

aList.add(2, “one”);

aList.remove(“one”);

System.out.println(aList + “n” +aList.size());

Expert Answer


Answer to Use java programming for the following questions to have the solutions ready within today Jan 3 2020 at or before 8:00P…

OR