Question: java question can you guys tell me the step how this code execute? public class TraceProgWMethods { public static void main(String[ ] args) { String

java question

can you guys tell me the step how this code execute?

public class TraceProgWMethods {

public static void main(String[ ] args) {

String message = "Guess what";

int a = 5, b = 7, c = 6;

double y = 6.4;

what1(b, c);

y += what2(message, a);

System.out.println(message);

System.out.println(b);

System.out.println(c);

System.out.println(y);

}

public static void what1(int num1, int num2) {

int a = 15;

double y = 12.4, z = 9.3;

num1++;

y = a / num2 + num1;

System.out.println(y);

System.out.println(num1);

z = what2("Who knows", num2);

System.out.println(z);

return;

}

public static double what2(String words, int num1) {

double result = 100.5;

System.out.println(words + " number?");

System.out.println("The number is " + num1);

words = "Finished my work.";

result = num1 + 1.2;

System.out.println(words);

return result;

}

}

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!