In: Computer Science
Given the method
static int test(int x, int y, int z){
return(x=y+z);
}
Which of the follwing is true:
public static void main(String[] args)
{
A System.out.println(test ( 7, 14, 23)) ;
B System.out.println(test ( test ( 7,9, 14) , 23 );
C System.out.println( test ( 14, 23 ) ;
D System.out.println(test(1,2,4), 14, 23)) ;
In case of any queries,please comment. I would be very happy to
assist all your queries.Please give a Thumps up if you like the
answer.
Option A is true
Correct answer is System.out.println(test ( 7, 14, 23)) ;
Program
public class Main
{
public static void main(String[] args)
{
System.out.println(test ( 7, 14,
23)) ;
}
static int test(int x, int y, int z)
{
return(x=y+z);
}
}
Function test will return 23+14 which is equal to 37
Output
37