Week 2 Flashcards

1
Q

Double quotes around the text =

A

a String of characters

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

+ in a String =

A

Strong concatenation operator

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

Escape Sequences

A
\t = tab
\n = newline
\r = carriage return
\” double quote
\’ = single quote
\\ = backslash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

variable

A

is a name for a “location” in memory

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

a variable must be declared with…

A

the type of information that it will hold

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

a bit can be either…

A

a 1 or a 0

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

a string of N bits can be used to represent…

A

2 to the Nth different values

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

8 primitive data types in Java

A
  • integer
    • byte 8 bits
    • short 16 bits
    • Int 32 bits
    • long 64 bits
  • floating
    • float 32 bits
    • double 64 bits
  • character
    • char 65,536 unique characters
  • boolean
    • boolean (true or false)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

an expression is made up of one or more …

A

variables, operators, and/or method invocations that evaluates to a single value.

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

arithmetic expressions

A

+, -, *, /, %(remainder aka modulus)

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

increment operator

A

++

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

decrement operator

A

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

x += count is the same as…

A

x = x+count

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

Relational Operators (for Boolean Values)

A
== Equal
!= Not equal
< less than
<= less than or equal 
> greater than
>=greater than or equal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Data conversions can occur in three ways…

A
  • assignment conversion – a value of one type is assigned to a variable of another. Allows only widening conversions. (ex. An int into a double)
  • promotion – happens when operators in expressions converts their operands. Happens in math equations.
  • casting – allows narrowing conversions and widening conversions. They type in parenthesis is placed in front of the value being converted. (result = (double) total/count)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

nextLine() next() are methods in…

A

the Scanner (import java.util.Scanner) class which return a String value

17
Q

nextInt(), and nextDouble()

A

convert to their type

18
Q

unless specified otherwise, tokens are

A

delimited by white space, which include spaces, tabs, newlines, and return characters.