Java ( Code Academy): Java variable Flashcards
We store information
in variables
Naming a piece of information allows us
to use that name later, accessing the information we stored.
Primitive data types
are types of data built-in to the Java system.
The three main primitive types
int, double, and boolean
The " escape sequence allows us to add
quotation marks “ to a String value. :
input: System.out.println(“"Hello World"”);
output: // Prints: “Hello World”
Using the \ escape sequence allows us
to place backslashes in our String text:
input: System.out.println(“This is the backslash symbol: \”);
output: // Prints: This is the backslash symbol: \
\n escape sequence in a String, the compiler will
output a new line of text:
System.out.println(“Hello\nGoodbye”);
/*
Prints:
Hello
Goodbye
*/
Creating and filling variables is a
powerful concept that allows us to keep track of all kinds of data in our program.