Question: 1. Create a class called CustomerListerArray with a main method that declares and instantiates an array of String objects called customerName. The array should have
1. Create a class called CustomerListerArray with a main method that declares and instantiates an array of String objects called customerName.
The array should have room for seven String objects.
Assign each of the following Strings to sequential locations in the array beginning at array index 0. Do not use an array initializer list to create the customerName array.
Chris
Lois
Meg
Peter
Stewie
Write an enhanced for loop to display the array of names so that each name is on a separate line
answer the following questions:
What is displayed for the last two array elements?
Why is it that value?
Add the Strings Meg and Brian into index 3, and 4, respectively, so that the array contains the following elements in this order:
Chris Lois Meg Meg Brian Peter Stewie
Write another enhanced for loop to display the array of names.
Write a second, traditional for loop that checks each element for the String Meg, if found in the array, remove it, shift the remaining elements, and display the array of names.
answer the question:
Are both instances of Meg removed correctly from the array?
Why or why not? In other words, explain what you observe in your code.
this needs to work in the latest version of dr java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
