Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java Method #3 Write a method, createAndFillArray, that receives a String and a size (size must be in 1-1000 range). The method creates an

image text in transcribedIn java

Method #3 Write a method, createAndFillArray, that receives a String and a size (size must be in 1-1000 range). The method creates an array of String of the received size and populates every element with the received String value. If received size is out of range, the method returns null. method signature: public static String [] createAndFillArray(String str, int size) // example: // String towns 1 = ArrayExamples.createAndFillArray("Austin", 4); // after call towns = ["Austin", "Austin", "Austin", "Austin") Method #4 Write a method, swapArrayValues, that receives an array of ints and 2 indexes, swaps values in the array that are located at the received indexes. For example list = [12, 35, 271(3 values stored as show in indexes 0, 1, 2) ArrayExamples.swapArrayValues(list, O, 1); // should swap values at index 0 and 1 list after call = [35, 12, 27] if either received index is OUT OF RANGE, method does NOTHING. out of range means the received index is not within the array boundaries. 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions