Why does Eclipse require me to set (arbitrary) brackets in java code?

后端 未结 5 1367
-上瘾入骨i
-上瘾入骨i 2021-01-29 11:56

I am currently trying to figure out how to use Eclipse to program Escape models in java. I am quite new to Escape and Eclipse, and it has been a while since I programmed in java

5条回答
  •  野性不改
    2021-01-29 12:17

    If you want to initialize the fields lattice, test and test2, try using the following:

        package ede.brook.model;
    
        import org.ascape.model.Scape;
    
        public class CoordinationGame extends Scape {
    
        private static final long serialVersionUID = 1L;
    
        public int latticeHeight = 30;
        public int latticeWitdh = 30;
        public int nPlayers = 200;
    
        Scape lattice = new Scape(new Array2DVonNeumann());
        Scape players;
    
        boolean test = true;
        int test2 = 3;
    
        }
    

提交回复
热议问题