Chapter 2 Flashcards

1
Q

in a program are used to store data such as numbers and letters. They can be thought of as containers of a sort. The number, letter, or other data

A

Variabels

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

To know the name of the variable, how much computer memory to reserve for the variable, and how the data item in the variable is to be coded as strings of 0s and 1s. You give this information in

A

variable declaration

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

The variable can hold whole numbers, such as 42, −99, 0, and 2001. A whole number is called

A

Integer

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

What is a data type for objects of a class called?

A

class type

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

How many primitive type do we have ?

A

8

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

Which Primitive Type has the range of -128 to 127

A

byte

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

Which Primitive Type has the range of -32,768 to 32,767 ?

A

short

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

Which Primitive Type has the range of -2,147,483,648 to 2,147,483,647

A

int

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

Which Primitive Type has the range of -9,223,372,036,8547,75,808 to 9,223,372,036,854,775,807

A

Long

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

What kind of value is char?

A

Single character (Unicode)

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

What kind of value is float?

A

floating-point

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

How much memory does boolean use?

A

1 bit

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

Which Primitive Type has the range of ±3.40282347 × 10 +38 to ±1.40239846 × 10 −45

A

Float

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

Which Primitive Type has the range of ±1.79769313486231570 × 10 +308 to ±4.94065645841246544 × 10 −324

A

double

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

Which Primitive Type has the range of 0 to 65,535

A

char

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

How many floating point do we have?

A

2

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

A number having a fractional part—such as the numbers 9.99, 3.14159, −5.63, and 5.0—is called

A

floating-point number

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

As with integer types, the differences between float and double involve the range of their values and their storage requirements. If you cannot decide between the types float and double, use

A

double

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

Are these legal identifier? inputStream, YourClass, CarWash, hotCar, theTimeOfDay

A

yes

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

We will always follow the convention that the names of classes start with

A

Upper case letter

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

the names of variables and methods start with

A

lower case letter

22
Q

Are these legal identifier prenhall.com, go-team, Five*, 7eleven ?

A

No

23
Q

What is wrong with this identifier prenhall.com ?

A

It has a dot in it

24
Q

What is wrong with this identifier go-team ?

A

It has a hyphen in it

25
Q

What is wrong with this identifier Five* ?

A

it has an asterisk in it

26
Q

What is wrong with this identifier 7eleven ?

A

it starts with a digit

27
Q

Some words in a Java program, such as the primitive types and the word if, are called

A

keywords or reserved words

28
Q

All Java keywords are entirely in what case?

A

lower case

29
Q

main and println are not keywords, then what are they?

A

predefined meaning

30
Q

What does predefined meaning mean?

A

you can change their meaning, but it is a bad idea to do so

31
Q

The most straightforward way to give a variable a value or to change its value is to use

A

assignment statement

32
Q

What does the “ = “ equal sign called?

A

assignment operator

33
Q

The computer evaluates what side of the “ = “ sign in an expression, right or left?

A

right

34
Q

A variable that has been declared, but that has not yet been given a value by an assignment statement called

A

uninitialized

35
Q

If the variable is a variable of a class type, it literally has no value. If the variable has a primitive type, it likely has some

A

default value

36
Q

This line must appear before the first statement that takes input from the keyboard. That statement in our example is

A

Scanner keyboard = new Scanner(System.in);

37
Q

What does this line do keyboard.nextInt() ?

A

reads one int value from the keyboard.

38
Q

System is a ____ that is part of the Java language, and out is ___

A

class, object

39
Q

What does this called 865000000.0. in a Floating-point?

A

scientific notation

40
Q

what is it public static final double PI = 3.14159; called?

A

Constants

41
Q

You can assign a value of any type on the following list to a variable of any type that appears further down on the list called:

byte → short → int → long → float → double

A

Assignment Compatibilities

42
Q

a _____ changes the data type of a value from its normal type to some other type.

A

type casting

43
Q

What are the 5 Arithmetic Operators?

A

+ - / * and %

44
Q

A __ has two operands, such as the operators + and * in

A

binary operator

45
Q

A string can even have zero characters. Such a string is called

A

empty string and is written as a pair of adjacent double quotes, like so:” “.

46
Q

You can connect or join or paste two strings together to obtain a larger string using +, called:

A

concatenation

47
Q

Any characters that are not visible when displayed are collectively known as

A

whitespace

48
Q

What is this "Java" called?

A

Escape Characters

49
Q

" Double quote. ' Single quote. \ Backslash.

\n New line. Go to the beginning of the next line.

\r Carriage return. Go to the beginning of the current line. \t Tab. Add whitespace up to the next tab stop. are example of ?

A

Escape Characters

50
Q

A method works like the print method except it allows you to add formatting instructions that specify things such as the number of digits to include after a decimal point.

A

printf

51
Q

This is called /** ?

A

javadoc

52
Q

This is called /* */ ?

A

long comment