Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

What is the output of the following program? public class MysteryProgra

0 votes
asked Dec 3, 2019 by anonymous
What is the output of the following program?

public class MysteryProgram {

public static void mystery(String foo, String bar, String zazz) {

System.out.println(zazz + " and " + foo + " like " + bar);

}

public static void main(String[] args) {

String foo = "peanuts";

String bar = "foo";

mystery(bar, foo, "John");

}

}

1 Answer

+1 vote
answered Dec 6, 2019 by gameforcer (2,970 points)
The output will be:

John and foo like peanuts
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...