For my code, I need to be able to check if a string is equal to a string from another class (Minion).
When I run this code, the Terminal keeps saying: 0/0
But when I remove the commenting:
The terminal says: null one and then the games stops.
What is going on?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public Things() { setImage(blank); GreenfootImage image = getImage(); image.scale(image.getWidth() - 250 , image.getHeight() - 250 ); setImage(image); } public void act() { System.out.println(Minion.chunk); //System.out.println(Minion.chunk.equals("0/0")); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public Things() { setImage(blank); GreenfootImage image = getImage(); image.scale(image.getWidth() - 250 , image.getHeight() - 250 ); setImage(image); } public void act() { System.out.println(Minion.chunk); System.out.println(Minion.chunk.equals( "0/0" )); } |