在下面的类中,我有一个非静态的ArrayList。我正在对该ArrayList进行非静态方法调用(add())。但我的IDE告诉我,我正在静态调用(Cannot make a static reference to the non-static field arrayList)。 import java.util.ArrayList;
public class Test {
priv
因此,我继续并像往常一样开始创建游戏。除了这一次,我得到了一个错误O.o.我试图找到答案,但非我认为也许在这里我可以得到一个很好的答案!继承人的错误: Description Resource Path Location Type Cannot make a static reference to the non-static field image Game.java /POGA/src/pac
我正在使用swing来制作带有JFrame的Java项目。我正试图调用非静态方法build(),它使用它的组件构建JFrame。但是,构建不能是静态的,因为我使用getClass(),它需要一个非静态方法。我不能让我的主要非静态,所以我怎么能称之为构建?这里是我的代码: public class MainUI {
public static void main(String[] args) {
我在写一个.Net库,这是我的场景: 我有一个包含“批次”列表的“经理”类。每批都有一个Status属性。 public class Batch
{
public string Status { get { return batchActualStatusVar; } }
}
BatchManager有一个枚举器,其键值等于可能的批处理状态。 public enum BatchStatu