public class a{
public static void main(String [] args){
//Here you have to call one of the methods of B.... You can get the B object via New
b b= new b();
b.speak();
}
}
public class b{
public static void speak(){
System. out.println("Thanks");
}
}
}
You can access each other's methods by creating an object of another class by new in the class...