1. What is the output of the following program? Explain why? public class Boy{ int age = 10; } public class School{ public static void main(String[] args){ Boy b1 = new Boy(); System.out.println(“Age...

11. What is the output of the following program?<br>Explain why?<br>public class Boy{<br>int age = 10;<br>}<br>public class School{<br>public static void main(String[] args){<br>Boy b1 = new Boy();<br>System.out.println(“Age =

Extracted text: 1. What is the output of the following program? Explain why? public class Boy{ int age = 10; } public class School{ public static void main(String[] args){ Boy b1 = new Boy(); System.out.println(“Age = "+ b1.age); Boy b2 = b1; System.out.println(“Age ="+ b2.age); b2.age = 15; System.out.println(“Age = "+ b1.age); } }

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here