Question: The following code fragment defines a class with 4 fields: class A: a = 1 _ b = 2 c = 3 _ _ d

The following code fragment defines a class with 4 fields:
class A:
a =1
_b =2
c =3
__d =4
How many fields can be directly accessed by another class B which inherits from class A and is defined in the same package as A ?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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

Students Have Also Explored These Related Programming Questions!