Defensive Programming: Part 1. Types, Conditionals, Assertions
Defensive Programming: Part 1.Types, Conditionals, Assertions
Atul Prakash Reading: Chapter 2-6 Downey. Sun's Java tutorials as
referenced in the slides
1
You should know from a previous programming course...
? Variables have types: integer, float, boolean, string, ...
? Operators: +, -, =, *, /, %, **, comparison operators, etc.
? if-then-else statements ? loops, e.g., while statements
2
Some surprises
? We will show that computer programs can behave in unexpected ways:
? x + 1 < x is possible ? (x == x) can compute to false ? (x != x) can compute to true ? x < y, x > y, x == y can all be false. ? This lecture: overview of Java, along with
discussion of nuances of types, conditional statements, and loops
3
Java Language Fundamentals
? The language syntax is similar to C/ C++
? We will contrast Java with Python where necessary
4
Keywords
? Keywords are reserved words ? ANSI C has around 32, Java around 50 ? Keywords in the Java Language
abstract
assert ***
boolean
break
beyte
case
catch
char
class
const *
continue
default
enum ****
final
for
goto *
do
double
else
instanceof
extends
interface
finally
float
new
package
if
implements
import
return
int
static
long
native
switch
synchronized
private
this
protected
throw
public
throws
transient
short
try
void
strictfp **
volatile
super
while
* not used ** added in 1.2 *** added in 1.4 **** added in 5.0
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- cs 107 lecture 2 integer representations
- c reference card ansi constants flow of control program
- signed and unsigned integers in c example
- exchange wikileaks
- sample problems for midterm exam
- eecs 213 midterm exam northwestern university
- security coding module integer error you can t count
- understanding integer overflow in c c university of utah
- defensive programming part 1 types conditionals assertions
- bits bytes and integers
Related searches
- part 1 illuminating photosynthesis answers
- part 1 illuminating photosynthesis worksheet
- ielts writing part 1 tips
- ielts speaking part 1 questions and answers
- ielts speaking part 1 education
- ielts speaking part 1 sample
- ielts speaking part 1 questions
- ielts speaking part 1 vocabulary
- ielts speaking part 1 question
- ielts speaking part 1 history
- ielts speaking part 1 samples
- breaking dawn twilight part 1 full movie