Question: Where will you see errors in the following code: A.java 1 package test; 2 3 public class A { 45 private int i; int

Where will you see errors in the following code: A.java 1 package test; 2 3 public class A { 45 private int i; int j; *B.java X 1 package newpack; 2 3 import test.A; 4 5 public class B { 69 B() { 69 int A() { 7 i=2; j=5; 8 } 9 100 void changeVal() { 11 12 i = i*j; return i: 13 } 14 15} 16 7 A a1 = new A(); 8 a1. changeVal(); 9 } 10 } 11
Step by Step Solution
3.51 Rating (151 Votes )
There are 3 Steps involved in it
The code has the following errors Class A method A has a return type of int but tries to assign a boolean value 12 which evaluates to false This shoul... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
6642ef925ab47_972682.pdf
180 KBs PDF File
6642ef925ab47_972682.docx
120 KBs Word File
