hiren43 Posted January 6, 2015 Posted January 6, 2015 Class B { int a; Void setA(int a) { a=a; } int getA() { return a; } } So I have this class B and I'm writing for main class which creates object of class B. My problem is that how both functions in B can be used through same object by different clsss. I mean to say that there are 2 users of my this system. One user is only concerned about setting A only. 2nd function only be used by another user who only concerns with getting the data. So how this is possible? How can we use same object but different user? One user sets the data by one object and second person even though being in another class can retrieve A's value using same object.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now