Ask Question
24 September, 21:50

Write the definition of a method, isReverse, whose two parameters are arrays of ints of equal size. The method returns true if and only if one array is the reverse of the other. ("Reverse" here means same elements but in reverse order.)

+4
Answers (1)
  1. 25 September, 00:19
    0
    The following are code in the Java Programming Language.

    //define boolean type function

    boolean isReverse (int ar[], int b[])

    {

    //declare integer type variable

    int x;

    //set the for loop

    for (x=0; x < ar. length && ar[x] = = b[ar. length-1-x]; x++);

    return x = = ar. length;

    }

    Explanation:

    The following are the description of the code.

    In the above code that is written in the Java Programming Language, we define the boolean data type function that is 'is Reverse () ' and pass two array integer data type arguments that is 'ar', 'b' in the then, declare integer data type variable that is 'x'. Set the for loop that the boolean type value is true or false.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write the definition of a method, isReverse, whose two parameters are arrays of ints of equal size. The method returns true if and only if ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers