• Post Reply Bookmark Topic Watch Topic
  • New Topic

data of the calling object  RSS feed

 
Mohamad Samy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
say i have some class called sorted to sort the linked list through the nodes of the list.
and other class to test this ability, i made object of the sort class called "list1" and insert the values to the linked list.
if i make other object called "list2" and want to merge those two lists by using method merge in sort class.
and wrote code of

how can the merge method in sort class know the values of list1 that called it as this object is created in other class.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamad Samy wrote:how can the merge method in sort class know the values of list1 that called it as this object is created in other class.

???

list1 defines your method, so of course it knows what values it contains.

Or maybe I don't understand the question.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!