Email *
Which of the following is an appropriate way of defining a method? *
1 point
True or False: All functions must have a return type. *
1 point
How many return types can a function have at most? *
1 point

public static void main(String[] args) {

    int c = 9;

    int d = 11;

    int bob = add(c, d);

    bob = add(bob, 20);

}

public static int add(int a, int b){

    return a+b; 

}


For the above code, what is the value of bob at the end of the main function?

*
1 point

Programming Question

Create a function that changes the array values by adding the previous element to it.

Example: {1, 2, 3} --> {1, 3, 6}

*
1 point
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy