Skip to content

syedumerahmedcode/leetcodechallenge-passbyvalueinjava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pass by Value

Table of content

Introduction

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
		 * 
		 */

Technologies Used

  • Java 11

Contribution

Feature requests, issues, pull requests and questions are welcome.

Contact Information

How to reach me? At github specific gmail account.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages