Select slides from
Chapter 1: Computer Systems
Presentation slides for
Java Software Solutions
for AP* Computer Science
by John Lewis, William Loftus, and Cara Cocking
Java Software Solutions is published by Addison-Wesley
Presentation slides are copyright 2003 by John Lewis, William Loftus, and Cara Cocking. All rights reserved.
Instructors using the textbook may use and modify these slides for pedagogical purposes.
*AP is a registered trademark of The College Entrance Examination Board which was not involved in the production of, and does not endorse, this product.
Problem Solving
2
Problem Solving
3
Java
4
Java Program Structure
5
Java Program Structure
6
public class MyProgram
{
}
// comments about the class
class header
class body
Comments can be placed almost anywhere
Java Program Structure
7
public class MyProgram
{
}
public static void main (String[] args)
{
}
// comments about the class
// comments about the method
method header
method body
Comments
8
// this comment runs to the end of the line
/* this comment runs to the terminating
symbol, even across line breaks */
/** this is a javadoc comment */
Identifiers
9
Identifiers
10
Reserved Words
11
abstract
boolean
break
byte
case
catch
char
class
const
continue
default
do
double
else
extends
false
final
finally
float
for
goto
if
implements
import
instanceof
int
interface
long
native
new
null
package
private
protected
public
return
short
static
strictfp
super
switch
synchronized
this
throw
throws
transient
true
try
void
volatile
while
White Space
12
Language Levels
13
Programming Languages
14
Java Translation
15
Java Translation
16
Java source
code
Machine
code
Java
bytecode
Java
interpreter
Bytecode
compiler
Java
compiler
Development Environments
17
Syntax and Semantics
18
Errors
19
Basic Program Development
20
errors
errors
Edit and
save program
Compile program
Execute program and
evaluate results