KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
If I have [EDIT: added the type definition for "Inner"] interface Inner{ public void execute(); } class Outer{ int outerInt; public void hello(){ Inner inner = new Inner(){ public void execute(){ outerInt=5; } } //later inner.execute(); } } will the call to inner.execute() set the outerInt variable of that particular Outer object to 5 , wherever it is called from, and for as long as that Inner object exists? Or will it just change a copy of the outerInt variable and not affect the original Outer object?
Tags (comma-separated)
Save Edits
Cancel