java - 为什么 Eclipse 编辑器中的更改不会影响我的代码?

标签 java eclipse

我尝试在另一台设备上更改代码,并通过 Dropbox 将代码从一台设备传输到另一台设备,但是当我更改代码时,程序的行为与以前相同。不知道为什么?!

//when collecting an Powerup-Item start a random Powerup
public static void pupHit() {

    ItemCreator.powerUp.setLocation(new Point(-50, -50));
    //usually I would generate a random number between 1 and 6 
    //with the commented 2 lines below and save it in the variable pup
    //Random rand = new Random();
    int pup = 6; //rand.nextInt(6) + 1;
    //even if I give pup a static value of 6, pup differs between 1 and 5/6
    switch(pup){
        case 1: ItemPowerups.speed(); Stats.points += 10; break;
        case 2: ItemPowerups.slow(); Stats.points += 5; break;
        case 3: ItemPowerups.lsd(); Stats.points += 15; break;
        case 4: ItemPowerups.invert(); Stats.points += 25; break;
        case 5: ItemPowerups.obstacle(); Stats.points += 10; break;
        case 6: ItemPowerups.steelJawbone(); Stats.points += 10; break;
    }   
}

我尝试在声明和初始化pup后添加System.out.printl(pup);。这也不会影响我的代码。

最佳答案

尝试再次构建它:D。 (我知道最后一个人解决了这个问题,但我们需要这个问题才能得到答案)。

关于java - 为什么 Eclipse 编辑器中的更改不会影响我的代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31091037/

相关文章:

java - 在java中在单个语句中执行多个查询

java - 调用此方法时如何放置 gnerics?

java - 使用 Reflections google library 的单元测试仅在由 Maven 执行时失败

java - "Selection does not contain any Java files"来自 Eclipse

c++ - C++ 项目的 ECLIPSE makefile -- 源目录

java - 在 Web 应用程序中使用 FreeTTS

java - 如何从 .json 文件中删除元素?

eclipse - 从 Eclipse 启动终端

java - 如何通过按下按钮发起调用?

java - ClojureScript 编译器如何将 cljs 转换为 Javascript