When we create an object how much memory will be allocated to it ? Is memory allocated for methods too ? If Yes, How ?
Rahul47
Recommended Answers
Jump to PostBeuase all the methods are the same, there's just one copy in memory. That's loaded when the class is loaded ie sometime before you first use it. The same is true of static variables.
Memory for instances of classes is created when the instance is created - that's a few …
All 3 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Rahul47
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.