Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
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:
Beginning Java
Help understanding excersise
Elim Banda
Ranch Hand
Posts: 46
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Can somebody help me understand what im supposed to be doing here I dont understand the question how should I think to solve this problem.
class HeapQuiz { int id = 0; public static void main(String [] args) { int x = 0; HeapQuiz [] hq = new HeapQuiz[5]; while ( x < 3 ) { hq[x] = new HeapQuiz(); hq[x].id = x; x = x + 1; } hq[3] = hq[1]; hq[4] = hq[1]; hq[3] = null; hq[4] = hq[0]; hq[0] = hq[3]; hq[3] = hq[2]; hq[2] = hq [0] ; //do stuff } }
ex1.JPG
Joe Bishara
Ranch Hand
Posts: 175
17
posted 8 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Hello Meki
You might find these threads useful:
Understanding Objects and Reference Variables
Head First into Java - A Heap o Trouble
Tushar Goel
Ranch Hand
Posts: 954
4
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
They want to you to draw a line which tells which reference variables stores which references.
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Someone teach me line by line how to read this particular code
A Heap O� Trouble :-- Head First Java
Array quiz I can't solve
matching reference variables with objects
Reference Variable puzzle
More...