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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started