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

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

1 Expert Approved Answer
Step: 1 Unlock

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

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

6642ef925ab47_972682.pdf

180 KBs PDF File

Word file Icon

6642ef925ab47_972682.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!