Java Question 1: Question 2: Question 3: Question 4:

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Java Question 1: Question 2: Question 3: Question 4:

Post by answerhappygod »

Java
Question 1:
Java Question 1 Question 2 Question 3 Question 4 1
Java Question 1 Question 2 Question 3 Question 4 1 (16.39 KiB) Viewed 29 times
Question 2:
Java Question 1 Question 2 Question 3 Question 4 2
Java Question 1 Question 2 Question 3 Question 4 2 (18.46 KiB) Viewed 29 times
Question 3:
Java Question 1 Question 2 Question 3 Question 4 3
Java Question 1 Question 2 Question 3 Question 4 3 (18.82 KiB) Viewed 29 times
Question 4:
Java Question 1 Question 2 Question 3 Question 4 4
Java Question 1 Question 2 Question 3 Question 4 4 (19.17 KiB) Viewed 29 times
What type of error (if any) is in the code below? ArrayList words = new ArrayList(); words.add("apple"); words.add("banana"); String first = words.get(0); compile time error only run-time error only O compile time and run-time error none of these is correct (there are no errors)
What is true after the execution of the following code? ArrayList<String> arrayList new ArrayList<String>(); arrayList.add("a"); arrayList.add("b"); arrayList.add("c"); arrayList.remove("b"); none of these are correct the list will contain ["a", "c"] a runtime exception will be thrown the list will contain ["a", null, "c"]
What is true after the execution of the following code? ArrayList<Integer> arrayList = new ArrayList<>(3); arrayList.add (45); arrayList.add(62); arrayList.add(33); arrayList.add (19); arrayList will contain 4 values O arrayList will contain 3 values a runtime exception will be thrown there will be a compiler error
What is true after the execution of the following code? ArrayList<String> arrayList = new ArrayList<String>(); arrayList.add("a"); arrayList.add("b"); arrayList.add("c"); System.out.println(arrayList.remove("x")); a runtime exception will be thrown false is printed O there is a compiler error -1 is printed "x" is printed
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply