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
Get step-by-step solutions from verified subject matter experts
