文档介绍:第一章复习题 Source program means the original program written ina high-level language. piler isa program that translates source program into executable code. Developed bya team led by James Gosling at Sun Microsystems in 1991. Originally called Oak, it became Java in 1995 when it was redesigned for developing applications. Keywords have specific meaning to piler and cannot be used for other purposes in the program such as variables or method names. Examples of keywords are class, static, and void. Java source code is case sensitive. Java keywords are always in lowercase. The source file extension is .java and the bytecode file extension is .class. public class e { public static void main(String[] args) { ( "morning" ); ( "afternoon" ); }} Line 2. Main should be main. Line 2. static is missing. Line 3: e to Java! should be enclosed inside double quotation marks. Line 5: The last ) should be }. javac is the mand pile a program. java is the mand to run a program. Java interpreter cannot find the .class file. Make sure you placed the .class in the right place, and invoked mand with appropriate package name. The class does not have a main method, or the signature of the main method is incorrect. 编程题 1-6 public class Exercise1_6 { public static void main(String[] args) { (1 +2+3+4+5+6+7+8+ 9); }} 1-7 public class Exercise1_7 { public static void main(String[] args) { (4 * (1- /3+ /5- /7+ /9- / 11+ / 13)); }} 第二章复习题 Valid identifiers: applet, Applet, $4, apps, x, y, radius Invalid identifiers: a++, --a, 4#R, #44, class, public, int Keywords: class, public, int Line 2: Missing static for the main method. Line 2: string should be String. Line 3:i is defined but not initialized before it is used in Line 5. Line 4:k is an int, cannot assign a double value to k. Lines 7-8: The string cannot be broken into two lines. bc -2