Question: how to transfer data from one class to another in java?
Answer: 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); }