Java Programming Class 1
Java Programming Class 1
class 1
What is a program?
● Set of Instructions ● Directions
● Ingredients ○ Statements
○ Variables ○ Execution
■ Numbers
■ Text
Anatomy of a class
System.out.print(“Hello World”);
}
Variable Types
Integer → Number (1, 2, 3, -1, 40, 526)
Float → Decimal Number (2.25, 0.56, 29.48)
Boolean → True and False
String → Text (“Hello”, “this is a string”, “NASA”)
Character → Single Character ( ‘A’, ‘b’ )
Creating Variables
int apples = 5;
int oranges = 3;
Usage:
System.out.print(apples);
System.out.println(superhero);
Punctuation
System.out.print(first + second);
● Review Slides
● Assignment will be emailed to you after
class
○ Due before tomorrow’s class