Computers and Technology

1- which of the following correctly creates an anonymous array and passes it's reference to a method named print? a) print ( {1, 2, 3} ); b) print (int [ ] x = {1, 2, 3} ) ; c) print (int [ ] {1, 2 ,3} ) ; d) print (new int [ ] {1, 2, 3} ) ; 2- which of the following shows the header for a method that correctly accepts a reference to an array and returns a reference to an array? a) public static void process (int [ ] x) b) public static double process (int [ ] x) c) public static double[ ] process (int [ ] x) d) public static double[ ] process (int [ ] {1, 2, 3} ) 3- if x is an array of int values with 10 elements defined inside a method, which of the following would return a reference to that array from the method? a) return x ; b) return x[0] ; c) return int[ ] x ; d) return new int[ ] x ; 4- which of the following shows the header for a method that will accept any number of int values? a) public static int add (int x) b) public static int add (int x, int y, int. . z) c) public static int add (int. . x) d) public static int add (int [ ] x) 5- which of the following method headers contains incorrect syntax? a) public static void print ( x) b) public static string getstring (string[ ] x) c) public static string getstring (string x, ) d) public static void print ( x, string y)

answer
Answers: 1

Similar questions

Do you know the correct answer?
1- which of the following correctly creates an anonymous array and passes it's reference to a method...

Questions in other subjects:

Konu
English, 23.02.2021 04:40
Konu
Mathematics, 23.02.2021 04:40