Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
Objects created on Heap
ramya ray
Ranch Hand
Posts: 101
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please explain how many objects are created on heap in a multi dimension array.
for eg:
int [][]a = new int[3][]; //how many objects will be created on heap?
and for
int [][]a = new int[3][5]; //how many objects will be created on heap?
Please explain.
Thanks.
Scott Johnson
Ranch Hand
Posts: 518
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
int [][]a = new int[3][]; //how many objects will be created on heap?
1 (A single array is created. That array is an object stored on the heap. The array has three null references.)
int [][]a = new int[3][5]; //how many objects will be created on heap?
4 (An array with references to three other arrays. Each array is an object on the heap.)
ramya ray
Ranch Hand
Posts: 101
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks a lot for replying ,I got it
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
garbage collection
How many objects created?
How many objects?
problems in number of objects created
How many objects will be created in Heap when we have multiple instances of a specific object?
More...