Question: /* Task 2. * * Requirements: * - It is strictly forbidden for you to use: * + Any Java library method (e.g., Arrays.sort) *

/* Task 2. * * Requirements: * - It is strictly forbidden for you to use: * + Any Java library method (e.g., Arrays.sort) * (That is, there must not be an import statement in the beginning of this class.) * + arrays * - You will receive an immediate zero for this task if the requirement is violated. * * Input Parameters: * - `n1`: first number * - `n2`: second number * - `n3`: third number * - `n4`: fourth number * Note. These four input numbers are not necessarily unique. They might contain duplicates. * * Error conditions (in order of priority): * - None. No error message is needed. * * What to return? * - Return a report of the smallest number and the second smallest number. * * See the JUnit tests related to this method for the precise format of the string return value. */ public static String getSmallestTwoNumbers(int n1, int n2, int n3, int n4) { String result = "";

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!