Ask Your Question
2

Is it possible to obtain the instance of the object that made the method call in Java?

asked 2023-06-01 17:45:21 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-01 18:01:02 +0000

david gravatar image

Yes, it is possible to obtain the instance of the object that made the method call in Java. Inside a non-static method of a class, you can use the "this" keyword to reference the current instance of the class.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-01 17:45:21 +0000

Seen: 7 times

Last updated: Jun 01 '23