Based on chapter 1 of the textbook "Building Java Programs", 3rd edition. Covers binary/decimal number conversion, the programming process, writing your very first program, console output, and procedural decomposition.
See a video presentation of this slideshow on my YouTube channel JavaGoddess, at https://www.youtube.com/watch?v=yYLfN_potQY&t=57s
4. Decimal Numbers
10 digits (0, 1, 2,
3, 4, 5, 6, 7, 8,
9)
Up by a power of
10 each place
value
Binary Numbers
2 digits (0, 1)
Up by a power
of 2 each
place value
10. The Process of Programming
1. Write
Code 2. Compile
3. Execute4. Debug
11. The Process of Writing
1. Write
Draft
2. Proofread
3. Share4. Revise
12. Types of Errors
Syntax
Writing code
incorrectly
Caught by
compiler
Example: clas
HelloWorld
public
Logic (bugs)
Code doesn’t work
as expected
Example: displaying
what you didn’t
want displayed
Runtime
Program is stopped
Example: infinite
loop
16. Identifier Do’s and Don’ts
Do’s:
Contain:
Letters
Numbers
Underscores ( _ )
Dollar signs ( $ )
Examples:
HelloWorld numberOfSpaces
$$money$$ _________ o_O
CAPS_LOCK iHave$0
Don’ts:
Start with a number
Contain spaces
Contain any characters not
listed to the left
Examples:
2Dimensional 3DPoint
funkySymbols@#$% :) :(
^o^
18. println vs. print
println: Write on the next line when displaying
things again
print: Continue writing on the same line when
displaying things again
20. Comments
//these comments
//take up one line each
/*
This comment
can take up as many
lines as I want.
*/
/*
I'm writing a
comment
/*/ inside
of a comment!
*/
//I'm free to
//"quote whatever
//I want"!
21.
22. Optional (for now) Knowledge
public: can be used in other programs
static: not involved in a specific object
void: no return value
main: default method
String[] args/String args[]: pass an array of Strings
as an argument
System: predefined class
out: a constant in the System class
println: a method that takes a String as a parameter