Question: All of the following questions pertain to Java code 1. What is the name of the first method in the code below? public class Code3

All of the following questions pertain to Java code

1. What is the name of the first method in the code below?

public class Code3 {

public static int add(int a, int b) { int c; c = a + b; return c; } public static void main (String [] args) {

int total; int x = 20; int y = 35; total = add(x, y);

System.out.print( " The sum of " + x + " and " + y + " is: " + total); } }

A. public

B. int

C. add

D. x,y

2. What part of the header highlighted below identifies it as a return-value method

public class Code4 {

public static int add(int a, int b) { int c; c = a + b; return c; } public static void main (String [] args) {

int total; int x = 20; int y = 35; total = add(x, y);

System.out.print( " The sum of " + x + " and " + y + " is: " + total); } }

A. main

B. add

C. static

D. int

3. What is x after the following statements execute?

int x =3;

int y = 4;

x* = y + 3;

A. 11

B. 18

C. 24

D. 21

4. Evaluate the expression:

"Welcome " + (1 + 3)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!