Question: Second output invalid for examples Java lang Code a method called get3rdSmallest that takes in an ArrayList of Integer as input and returns a String

Second output invalid for examples Java lang
Code a method called get3rdSmallest that takes in an ArrayList of Integer as input and returns a String to represent the third smallest element in the array. The code should make sure that the array size should always be larger than or equal to 3, else returns "invalid" to indicate such invalid case. Note: You are not allowed to use any method/class we have not introduced. You must use the most appropriate patterns. Examples: Input: (3, 5, -1, 10, -99] Output: "3" Input: {-99, -12} IA
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
