
90 CHAPTER 2 Programming Building Blocks—Java Basics
EXERCISES,PROBLEMS, AND PROJECTS
39. Is there an error in this code sequence? Explain.
boolean a = 1;
2.7.5 Debugging Area—Using Messages from the Java Compiler and Java JVM
40. You coded the following on line 8 of class Test.java:
int a = 26.4;
When you compile, you get the following message:
Test.java:8: possible loss of precision
found : double
required: int
int a = 26.4;
^
1 error
Explain what the problem is and how to fix it.
41. You coded the following on line 8 of class Test.java:
int a = 3
When you compile, you get the following message:
Test.java:8: ‘;’ expected
int a = 3
^
Explain what the problem is ...