Chapter 1 Flashcards

1
Q

Java identifier

A

A sequence of letters, digits, underscores, and dollar signs that must begin with either a letter or an underscore.

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

keywords in Java

A

Certain identifiers reserved by Java

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

Variable

A

Represents a memory location that contains a value of a primitive data type or a reference.

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

How to declare a variable’s data type

A

You declare a variable’s data type by preceding the variable name with the data type, as in
double radius;
String name;

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

What are the four categories of primitive data types in Java?

A
  1. Boolean
  2. Character
  3. Integer
  4. Floating Point
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Integral Types

A

Character and integer types (primitive types, that is)

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

Arithmetic types

A

Integral and floating point types

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

Integer values

A

These are signed and allow numbers such as -5 and +98.

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

Floating-point Types

A

These provide for real numbers that have both an integer portion and a fractional portion.

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

Wrapper class

A

Everything in Java is an object, except primitive data types. As a solution to this problem, Java allows you to include the primitives in the family of objects by using what are called wrapper classes.

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

Autoboxing

A

Makes it easier to convert from a primitive type to their equivalent wrapper class counterparts.

Integer intObject = 9;

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

Auto-unboxing

A

The reverse process of converting an object of one of the wrapper classes into a value of the corresponding primitive type.

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

References in Java

A

Java has one other type that is used to locate an object. This reference variable contains an object’s location in memory.

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

Literal constants

A

Indicate particular values within a program.
4 * Math.PI * radiusCubed / 3
(4 & 3 are literal constants)

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

Backslash notation

A

This notation is useful when you want to embed one of these characters within a literal character string.

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

Named constants

A

Have values that do not change. The declaration of a named constant is like that of a variable, but the keyword final precedes the data type.

17
Q

Assignment Statement

A

Assigns the value of an expression to a variable.

18
Q

What is an Array?

A

An array is a collection of elements, items, or values that have the same data type. Contains a finite, limited number of elements. Is direct, or random, access data structure.