|
-
Apr 2nd, 2007, 11:08 AM
#1
Thread Starter
Hyperactive Member
Passing values between two classes
Hi
It is a basic OOP methodology that the members of a class can be passed into other class by making other class sub class of that class using extends keyword.
My question regarding this is I want to assign a value of a variable say
int i of a class say class A into a variable say int j of another class say class B without any using of inheritance.
Is this possible?
class A
{
int i=6;
}
class B
{
int j;
}
The second problem in it is that I have created a method that the value of int i is changing, so I want to pass it in the int j variable and save it in j. So whenever I want to call the saved value I get it. How this is possible?
Thanks in Advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|