🧑‍💻Copy Constructor in Apex



 Copy Constructor:- If we want to create multiple instances with the same value then we can call the                                          copy constructor

Let's see with an example

Apex Class:-



In this above class, you can see line 13 is a copy constructor because I passed class as a parameter in it

Calling class with a method:-

Memory Location:-

Output:-


Contact Me - 

Salesforce Hunt Social Media Handle

🔔 Subscribe to my YouTube channel

https://www.youtube.com/c/SalesforceHunt

📌Website

https://salesforcehunt.online

📌Blog 

https://salesforcehunt.blogspot.com

📌FaceBook

https://www.facebook.com/salesforcehunt

📌Linkedin

linkedin.com/in/salesforce-hunt-b6aab3227

📌Twitter

https://twitter.com/salesforce_hunt

📌Instagram

https://www.instagram.com/salesforcehunt

📌Pinterest

https://in.pinterest.com/salesforcehunt

📌Quora

https://www.quora.com/profile/Salesforce-Hunt

📌Telegram

https://t.me/joinchat/fccG1UqNg1dhMTQ1

📌Reddit

https://www.reddit.com/user/Rohit_Bhadana

Post a Comment

0 Comments