• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Linked List

 
Arjunkumar Shastry
Ranch Hand
Posts: 986
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In C,suppose we want to initialize the Linked List in one function and print it in another function,we just pass the pointer to it to a fuction who prints it,thats we pass head of the linked list.
In Java,how to achieve that,there is a class LinkedList and we can do all list operations mentioned.But in scenario like above,should the entire linked list to be passed as there are no explicit pointer?
Or passing linked list in java means internally,passing the pointer,thats head?
 
Arjunkumar Shastry
Ranch Hand
Posts: 986
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot: Objects are passed as references in java.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arjunkumar Shastry:
I forgot: Objects are passed as references in java.


 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic