What will be the output of the program?class Two { byte x; } class PassO { public static void main(String [] args) { PassO p = new PassO(); p.start(); } void start() { Two t = new Two(); System.out.print(t.x ' '); Two t2 = fix(t); System.out.println(t.x ' ' t2.x); } Two fix(Two tt) { tt.x = 42; return tt; } } - Study24x7
Social learning Network
study24x7

Default error msg

Login

New to Study24x7 ? Join Now
Already have an account? Login
22 Feb 2023 12:42 PM study24x7 study24x7

What will be the output of the program?class Two { byte x; } class PassO { public static void main(String [] args) { PassO p = new PassO(); p.start(); } void start() { Two t = new Two(); System.out.print(t.x + " "); ...

See more

A

null null 42

B

0 0 42

C

0 42 42

D

0 0 0

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles