O'Reilly logo

Java Illuminated, 3rd Edition by Anderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPENDIX G

Solutions to Selected Exercises

1.7 Exercises, Problems, and Projects

1.7.1 Multiple Choice Exercises:

 1. Java

 4. servers.

 7. is a multiple of 4.

10. C

13. javac Hello.java

1.7.2 Converting Numbers

16. 11000011100

19. 0x15

1.7.3 General Questions

22. 1.5 billion

25. red = 51; green = 171; blue = 18

28. javac

2.7 Exercises, Problems, and Projects

2.7.1 Multiple Choice Exercises

 1. int a;

2.7.2 Reading and Understanding Code

 4. 12.5

 7. 2.0

10. 4

13. 5

16. 2.4

19. 5

22. 0

2.7.3 Fill In the Code

25. boolean a; a = false;

28. float avg = (float) ( a + b ) / 2; System.out.println( “The average is” + avg );

31. a *= 3;

2.7.4 Identifying Errors in Code

34. Cannot assign a double to a float variable (possible loss of precision).

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required