Question: Please write code in Java 3) Given an Arraylist of integers and an index position, write the method below which should return the integer in

Please write code in Java
Please write code in Java 3) Given an Arraylist of integers and

3) Given an Arraylist of integers and an index position, write the method below which should return the integer in the Arraylist at the given index position if the argument value for pos is a valid index position. If pos is not a valid index position, the method should return a 1. Example calls and return values for the method are shown below. Write the code needed for the method to work as intended. getNumber ({6,8,2,4},1)8 getNumber (6,8,2,4},3)4 getNumber (6,8,2,4},5)1 getNumber ({6,8,2,4},3)1 public int getNumber( ArrayList nums, int pos) \{ \} 4) Given an integer array of length 2 , the method below should return true if the array does not contain 2 or 3 . If the array contains a 2, a 3, or both 2 and 3 then the method should return false, Example calls and return values for the method are shown below. Write the code needed for the method to work as intended. no23({4,5}) true no23 ({4,2}) false no23 ({3,5}) false public boolean no23( int[] nums)

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!