Answers to Self-Review Exercises
6.1 |
|
6.2 |
|
6.3 | The following solution demonstrates the Math class methods in Fig. 6.2:
1 // Exercise 6.3: MathTest.java 2 // Testing the Math class methods. 3 4 public class MathTest 5 { 6 public static void main( String args[] ) 7 { 8 System.out.printf( "Math.abs( 23.7 ) = %f\n", Math.abs( 23.7 ) ); 9 System.out.printf( "Math.abs( 0.0 ) = %f\n", Math.abs( 0.0 ) ... |
Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.