cannonball.java
来自「一些JAVA的小程序」· Java 代码 · 共 26 行
JAVA
26 行
//// CannonBall class// Described in Chapter 6 of// Understanding Object-Oriented Programming with Java// by Timothy A Budd// Published by Addison-Wesley//// see ftp://ftp.cs.orst.edu/pub/budd/java/ReadMe.html// for further information//public class CannonBall extends Ball { public CannonBall (int sx, int sy, int r, double dx, double dy) { super(sx, sy, r); setMotion (dx, dy); } public void move () { dy = dy + 0.3; // effect of gravity super.move(); // update the ball position }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?