This project contains a small program which highlights the core concept of 'pass by value' in Java technology. The core explanation is as follows:
/**
* The values are printed as a1:test1 and a2:test2
* This is because in a1 contains the address 0xABCD
* a2 contains the address 0xEFGH
* after swapping a1 contains the address 0xEFGH
* and a2 contains the address 0xABCD
* but when we set animal1.name="test2";then basically
* 0xEFGH contains value test2
* 0xABCD contains value test1
* Hence, we are getting:
* After Swap:- a1:test1; a2:test2
*
*/
- Java 11
Feature requests, issues, pull requests and questions are welcome.
How to reach me? At github specific gmail account.