Sources:
- Head First Java 2nd Edition
- MOOC on Coursera: Java for Android
ProTips:
- When calculating the volume of a sphere, 4/3 pi r^3, always write
4.0/3.0 * Math.PI * Math.pow(radius,3)
.
Pay attention to the 4.0/3.0, if you write 4/3, Java will return 1 because integers always rounded down.