如果不是静态方法,则为实例方法。这是一个或另一个。是的,您的方法,
public void example(String random) { // this doesn't appear to do anything}是实例方法的示例。
关于
并想知道您到底如何使用实例方法
您将创建类的实例,对象,然后在该实例上调用实例方法。即
public class Foo { public void bar() { System.out.println("I'm an instance method"); }}可以这样使用:
Foo foo = new Foo(); // create an instancefoo.bar(); // call method on it



