You can supply an unlimited number of constructors until you run out of memory

Joined
Jan 13, 2023
Messages
10
Reaction score
1
Hi,
I read this statement in a C# book:
You can supply an unlimited number of constructors until you run out of memory or out of distinct sets of parameters.
What does "until you run out of memory" mean here ?
How can adding constructors make you run out of memory ?

Thanks
 
Last edited:
Joined
Sep 4, 2022
Messages
129
Reaction score
16
1 - it means your app can create objects ( from a class constructor ) as far as you have memory available ( ram amount ).

2 - a constructor implies an object after creation, it has a 'cost for memory'.
belonging to the memory available in the current thread, you can reach the max available memory and so crash the thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,794
Messages
2,569,641
Members
45,355
Latest member
SJLChristi

Latest Threads

Top