1st Six Weeks Flashcards
When drawing a program, what are the variables called?
STATE
Name the primitive data types.
byte, int, long, short, char, boolean, float, and double
When drawing a program, what are the methods called?
BEHAVIOR
How do you write a main method?
public static void main(String[] args){
What does a byte contain?
A byte contains numbers between -128 to 127. Ex: 76
What does an int contain?
An int contains numbers between -2,147,483,648 to 2,147,483,647. Ex: 838,382
What does a short contain?
A short contains numbers between -32,768 to 32,767. Ex: -16,392
What does a long contain?
A long contains numbers between -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Ex: 477,838,383
What does a boolean contain?
A boolean contains the values of true and false.
What does a double contain?
A double contains numbers with decimals. Ex: 10.8
What does a float contain?
A float contains numbers that are decimals. One must put a lower case f at the end to indicate that the variable is a float. Ex: 78.4f
What does a char contain?
A char contains any character, surrounded by single quotes. Ex: ‘%’
What does int stand for?
Integer
What does char stand for?
Character
How does one instantiate a reference type?
Ex: Puppy puppy1 = new Puppy();