-
Referencing of Instances
class A { // some code here} class B { // some code here}class Ex {public static void main(string args[]) {A a=new B();B b=new A();a.add();b.add();}Will this program run? Explain the referencing the object instances. What is the result;
-
If a variable is declared as private, where may the variable be accessed
A private variable may only be accessed within the class in which it is declared.