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