Check out example codes for "how to operate on values from different classes in java". It will help you in understanding the concepts better.

Code Example 1

class A {
int a = 10;
public class B{
public static void main (String args[]){
A a = new A();
System.out.println("I live in A " + a.a);

Learn ReactJs, React Native from