JAVA
JAVA
BASIC JAVA PROGRAM
JAVA
BASIC DEFINITIONS
▸ Variable - a name that refers to a value
▸ Literal - the actual value directly written into the code
▸ Declaration - specifies the name and type of a variable
▸ Assignment - assigns a literal value to a variable
Variable
Declaration
Assignment
Literal
JAVA
DATA TYPES
Type values example
int integers 13 256 -12
double floating-point numbers 3.1415 2.4 -0.13
boolean truth values true false
char characters A’ ‘z’ ‘!’
String words and sentences “Hello” “I like food.”
Primitive types
Object
JAVA
VARIABLES AND MEMORY
int myint;
myint = 42;
RAM
myint
Code
42

Variables and data types for java programming

  • 1.
  • 2.
  • 3.
    JAVA BASIC DEFINITIONS ▸ Variable- a name that refers to a value ▸ Literal - the actual value directly written into the code ▸ Declaration - specifies the name and type of a variable ▸ Assignment - assigns a literal value to a variable Variable Declaration Assignment Literal
  • 4.
    JAVA DATA TYPES Type valuesexample int integers 13 256 -12 double floating-point numbers 3.1415 2.4 -0.13 boolean truth values true false char characters A’ ‘z’ ‘!’ String words and sentences “Hello” “I like food.” Primitive types Object
  • 5.
    JAVA VARIABLES AND MEMORY intmyint; myint = 42; RAM myint Code 42