Question: 1) Given obj1.setWeight(5); Does the method setWeight have access to most of the instance variables of obj1. 2) Valid or Invalid. X obj=new X(); /

1) Given obj1.setWeight(5); Does the method setWeight have access to most of the instance variables of obj1.

2) Valid or Invalid.

X obj=new X(); /

obj.a = 20;

obj.b=30;

3) Valid or Invalid.

boolean flg=obj1

4) From part 2, Valid or Invalid

X obj=new X();

obj.c=10;

X.c=20;

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 Databases Questions!