Question: Java Programming: Q8. What is the output of the following two programs? public class myWork public static void main(Stringl] args) int x 20 addValueTo(x); System.out.printin(x);
Q8. What is the output of the following two programs? public class myWork public static void main(Stringl] args) int x 20 addValueTo(x); System.out.printin(x); static void addValueTolint y) yay +12 2. class Person public static int x; public static void main(Stringl ] args) ( Person.x-1 Person.x++ Person p1-new Person(): p1xt+; Person x+ System.out.println(p1.x) System.out.println(p1.x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
