Write an implementation of the following method in Java.?

public class method{

public static void main (String [] args) {

int [] X = new int [];

double []B = new double [];

double []C = new double [];

double []D = new double [];

initInt (X); // . Method to initialize Array X with random integer values range from to .

System.out.println(“Sum is =”+ sum (X); //. Returns the sum of all values in array X.

initDouble(C); //. Initialize array C with double values from random numbers // ranging from . to ..

copyArray (C,B); //. This method will copy the context of Array C to Array B in reverse order.

//(ex. The context of the first element at Array C will be the content of the last element at Array B.

If (compare (C,B)) //. Return true if the contents of Array C is equal to the content of Array B System.out.println (“Array B has the same value to Array C”);

addarray(B,C,D); //. Add the content of each element in B & C, stores it to each element in D int no = ;

If (found )X, no)) //. Returns true if the value N is found in array X

System.out.println(“Number “+N + “is found in the Array”);



Note: The above program should be implemented as one single class.

🥇 Favorite Answer

  • Basically, you have to write a program using that as a skeleton.

  • See also  Unity 3D script help!?

    Leave a Comment