Question: in java How many objects are created in the following code: Please be sure that you state syntax errors in the code, if any. Please
in java
How many objects are created in the following code: Please be sure that you state syntax errors in the code, if any. Please provide a strategy for solvig the problem for partial credit. public class RAM { int size; RAM(int size) { this.size = size; } } public class Motherboard { int x = 1; RAM ram = new RAM(8192); public static void main(String [] a) { Classroom myroom = new Classroom(2); } } class Computer { Motherboard m[]; Computer(int x) { m = new Motherboard[x]; for (int i = 0; i < m.length; i++) m[i] = new Motherboard(); } } class ClassRoom { Computer c1[]; ClassRoom(int x) { c1 = new Computer[x]; for (int i = 0; i < c1.length; i++) c1[i] = new Computer(7); } } Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
