Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get,set !

 
Anas El-Abboud
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
would you tell me the way i can make : get() in class to parameters in another class without set() in the last one ?
thanks , please with simple example..
 
Ben Buchli
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I dont understand your question, you might want to rephrase it.
Ben
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Anas El-Abboud:
would you tell me the way i can make : get() in class to parameters in another class without set() in the last one ?

If my understanding is correct, you're trying to code a class that has getter methods that will get values in another another class.
This isn't the normal way that we do things. Every POJO has its own set of getter & setter methods to allow another class to access/change its values. Not the other way round, as what you're trying to do.
 
Anas El-Abboud
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Cheng ! , i know that is not the normal way..
but in a sender class it was sending values to the receiver all the methods in the first setting values were had a getter method but in the second class !
i donn't know if that was right .but !
thanks again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic