Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If you return a reference to an object which happens to be a method - local variable, the return happens before the method s local

If you return a reference to an object which happens to be a method-local variable, the return happens before the methods local variables are destroyed. So you can create an object in your method and return it knowing the calling method will have use of the object you just created. This is because when your local object reference is destroyed, the calling method has a ____________ to your object so the JVM will not destroy it since it has an active reference to it.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions