Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. Write code for the following methods: (a) (10 points) Given a list, an integer start, and an integer end, the method subList should return

image text in transcribed
image text in transcribed
6. Write code for the following methods: (a) (10 points) Given a list, an integer "start", and an integer "end", the method subList should return a new list containing the elements from "start" up to but not including "end". For example, if we invoke this method on the list [ "a", "b", "c", "d"], with start =1 and end =3, the method should return [ "b", "c" ]. public static String[] subList(String[] 1ist, int start, int end) f (b) (10 points) Given a list of Strings, and a name that we are looking for, the method find should return the first position of that name in the list. For example, if the list is [ "Athar", "Bob", "Carl", "David", "David"], and we are looking for "David", the method should return 3 . If the name is not found in the list, the method should return 1. public static int find(String [] names, String name) \{

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_2

Step: 3

blur-text-image_3

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago