63 125
Assignments Done
99%
Successfully Done
In July 2018

Answer to Question #59354 in Java | JSP | JSF for Tshidi

Question #59354
The user enters the following code. What will be the value of
total after the code is executed?
val1 = 4;
val3 = 20;
total = sum(val1,val3);
Expert's answer
package com.company;

public class Main {
static int sum(int a, int b) {
int total;
total = a + b;
return total;
}
public static void main(String[] args) {
int val1 = 4;
int val3 = 20;
int total = sum(val1,val3);
System.out.println("Total = " + total);
}
}


Total = 24

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions