For example, if you have a class A ... and a class B
public class A {
public static void main (string [] args) {
/Here you need to call a method of b ... You can get the b object through New
b b= new b ();
b.speak();
}
}
public class b {
public static void speak () {
system. out.println ("thank you");
}
}
You can access each other's methods by creating new objects of another class in the class. ..