Please check out the new Help Developer forum

Show Sidebar

Java - accessing methods from other classes

April 9, 2008

I am going to show you how to link to methods in other classes in Java
public class ClassName {
private int index;
private String name;
public ClassName() {
index = 0;
name = “Simon”;
}
public void methodName {
// method here
}
}
Now we are going to access a method called otherClassMethodName from the class OtherClass, look at the code in red, this [...]