fork download
  1. public void FlipDirection (BouncingBall bouncingBall, BouncingBall bouncingBall2) {
  2.  
  3. if(bouncingBall.x + size > bouncingBall2.x - size || bouncingBall2.x + size > bouncingBall.x - size)
  4. {
  5. bouncingBall.xMove *= -1;
  6. bouncingBall2.xMove *= -1;
  7. bouncingBall.x += bouncingBall.xMove;
  8. bouncingBall2.x += bouncingBall2.xMove;
  9. }
  10.  
  11. if(bouncingBall.y + size > bouncingBall2.y - size || bouncingBall2.y + size > bouncingBall.y - size)
  12. {
  13. bouncingBall.yMove *= -1;
  14. bouncingBall2.yMove *= -1;
  15. bouncingBall.y += bouncingBall.yMove;
  16. bouncingBall2.y += bouncingBall2.yMove;
  17. }
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
public void FlipDirection (BouncingBall bouncingBall, BouncingBall bouncingBall2) {
       ^
Main.java:6: error: class, interface, or enum expected
			bouncingBall2.xMove *= -1;
			^
Main.java:7: error: class, interface, or enum expected
			bouncingBall.x += bouncingBall.xMove;
			^
Main.java:8: error: class, interface, or enum expected
			bouncingBall2.x += bouncingBall2.xMove;
			^
Main.java:9: error: class, interface, or enum expected
		}
		^
Main.java:14: error: class, interface, or enum expected
			bouncingBall2.yMove *= -1;
			^
Main.java:15: error: class, interface, or enum expected
			bouncingBall.y += bouncingBall.yMove;
			^
Main.java:16: error: class, interface, or enum expected
			bouncingBall2.y += bouncingBall2.yMove;
			^
Main.java:17: error: class, interface, or enum expected
		}
		^
9 errors
stdout
Standard output is empty