【发布时间】:2008-12-08 12:55:50
【问题描述】:
我有一个类,其中定义了两个方法。
public class Routines {
public static method1() {
/* set of statements */
}
public static method2() {
/* another set of statements.*/
}
}
现在我需要从 method2() 调用 method1()
以下哪种方法更好?或者这是否可以作为一个问题?
public static method2() {
method1();
}
或
public static method2() {
Routines.method1();
}
【问题讨论】:
标签: java coding-style