Question: programming by java please Lab objectives Practically familiarize student with the concept of 2D array and related operations performed on array Practically familiarize student with

programming by java
please
 programming by java please Lab objectives Practically familiarize student with the

Lab objectives Practically familiarize student with the concept of 2D array and related operations performed on array Practically familiarize student with the concept of ArrayList and related operations performed on that list Exercise 1 Use the following methods to complete the missing lines in the code Check if an ArrayList is empty using the sEmpty() method. Add these companies to the list: Google. Apple, Microsoft, Amazon, Facebook Find the size of an ArrayList using these method. Access the element at a particular index in an ArrayList using the geti method. Modify the element at a particular index in an ArrayList using the set method. public class AcessingArrayList { public static void main(String[] args) { ArrayList topConpanies = new ArrayList(); // 1. Check if an ArrayList is empty System.out.println("Is the top Companies list empty? :" + 1/2. add these companies to the list: Google, Apple, Microsoft, Amazon, Facebook // 3. Find the size of an ArrayList System.out.println("Here are the top companies in the world"); System.out.print in (top Companies); // 4. Retrieve the element at a given index (Best company lies in the 1st index, second best company in 2 index, and last company will be at the end of the list) String best Company String secondBest Company = String lastCompany System.out.println("Best Company: " + bestCompany); System.out.println("Second Best Company: ".second Best Company): System.out.println("Last Company in the list: " + lastCompany): // 5. Modify the element at a sth index to be walmart Systen.out.println("Modified top companies list: topcompanies)

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!