Classes and objects

Respected Sir,
Say in a program we have a class xyz.
Case 1:-
If we create an object xyz a, can you please tell which function is called automatically.
Case 2:-
In a different case, we execute the line,
xyz b=a, which function is called in this case?
Is the constructor for xyz called for both the cases or for only the first case?
My say:-
For case 2, first the constructor for the class is called and then the copy constructor.
Am i correct, if not please explain sir.

Constructor of that class, it’s called immediately whenever you make an object of it.

Copy constructor is called

For both cases they are called seperately

Yes you are absolutely correct.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.