I still don't understand final and static
I may read the tutorial several times
can you explain them to me and tell me how to use them with short examples?
thank you


1 2 3 4 5 6 7 8 9 | public class MyWorld extends greenfoot.World { public static int WIDE = 11 , HIGH = 7 ; public MyWorld() { super (WIDE, HIGH, 40 ); prepare(); } |
1 2 3 4 5 6 7 8 9 | public void act() { // create new larger world when clicked if (Greenfoot.mouseClicked( this ) && MyWorld.WIDE < 21 ) { MyWorld.WIDE += 2 ; Greenfoot.setWorld( new MyWorld()); } } |