Variables Flashcards

1
Q

Variables

A

Named locations in memory where we store information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Primitive Data Types

A

Types of Data built-in the Java system. The three main types are int, double, and Boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Literal

A

When the code is used to represent a fixed value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Ints

A

Store the whole number, with no fractions or decimals. Can be positive, negative, or zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Double

A

Can store much higher numbers than int and can also store decimals and fractions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Booleans

A

Reference either true or false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Char

A

Holds any character, and surrounded by single quotation marks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

String

A

Not a primitive type, holds a sequence of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to create a string using a String literal

A

String greeting = “Hello World”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to create a string by calling the String class

A

String greeting = new String(“Hello World”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Escape Sequences

A

Symbols with an alternative use in Java print Statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Escape sequence for “”

A

"

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Escape sequence for \

A

\\

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Escape sequence for a new line

A

\n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What do variable names have to start with?

A

A letter, _, or $

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
A