我正在製作一個我的世界MOD,我不知道哪一個更值得推薦。哪一個更有記憶效率?
Block[] blocks = new Block[] {BlueBlock, MeatBlock, ....};
for (Block bls : blocks)
GameRegistry.registerBlock(bls, bls.getUnlocalizedName().substring(5));
或
GameRegistry.registerBlock(BlueBlock, "BlueBlock");
GameRegistry.registerBlock(MeatBlock, "MeatBlock");
GameRegistry.registerBlock(..., "...");
感謝您的回答!我只是意識到,Java有GC ... – 2014-09-24 09:48:18