This is my code
Class Test { public SomeOtherClass objectA ; objectA = new SomeOtherClass(); System.out.println("After instantiation :"+objectA ) } Class Retrieve { System.out.println("After retrieving :"+ objectA ) }
Both the classes are in the same package Output is
After instantiation :samplepackage.SomeOtherClass@4c21356 After retrieving : null
1.4m articles
1.4m replys
5 comments
57.0k users