Java Basics Flashcards

1
Q

What is BIT an acronym for?

A

Binary Digit

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

How many bits in a byte?

A

8

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

How many possible values are in a byte?

A

256, or 2^8

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

What two types of programs translate source code to object code?

A

Interpreters and Compilers

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

Which type of translator program translates and executes line by line?

A

Interpreter

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

Is a compiler able to run source code?

A

NO

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

Which runs faster, interpreter or compiler?

A

Compiled programs

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

What two programming paradigms exist?

A

Procedural and Object Oriented

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

What is task decomposition?

A

Looking at an overall process and breaking down into smaller (atomic) tasks

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

What is another word for task decomposition?

A

Task Analyses

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

What did task analyses lead to?

A

Creation of algorithms

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

What two things do algorithms consist of?

A

1) What needs to be done

2) What order

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

What are the three control structures for any program?

A

1) Sequence
2) Selection
3) Repetition

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

What two things does an object have?

A

1) Properties (variables)

2) Methods

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

What is the Java API?

A

Application Programmer Interface, holds libraries of objects.

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

What is special about Java source code?

A

It can be run on any machine without changing it.

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

What is the Java compiler program called?

A

javac.exe

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

What is Java source code compiled to?

A

Byte code

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

Is Byte code able to run on any processor?

A

No

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

What is the JVM or JRE?

A

Java Virtual Machine or Java Runtime Environment, interpreter program specific to each processor.

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

Where is data from the keyboard stored in Java?

A

The Keyboard Buffer

22
Q

What do you need to do to use a package from the Java API?

A

Import statement

23
Q

Which input statement flushes the keyboard buffer?

A

input.nextLine();

24
Q

Which statements need to be flushed afterwards?

A

nextInt(), nextFloat(), next(); nextDouble();

25
Q

What is the character at the end of typing called?

A

End of Line character
New Line character
Carriage Return

26
Q

What is a variable?

A

A storage location in the computer’s memory, or RAM.

27
Q

What two things must a variable have?

A

1) A name

2) A data type

28
Q

What are three other ways to say variable name?

A

1) Identifier
2) Reference
3) Handle

29
Q

To create a variable, you must _______ it.

A

Declare

30
Q

What are we doing when we declare a variable?

A

Binding to a memory address

31
Q

What can a variable name NOT start with?

A

A number

32
Q

What CAN a variable name start with?

A
A letter (A,a)
A dollar sign ($)
An underscore (_)
33
Q

What words can’t be variable names?

A

Java Reserved Words

34
Q

Why do we specify data types when declaring a variable?

A

It tells the computer how many bytes of memory to allocate the variable

35
Q

ASCII and UNICODE share ___ characters.

A

256, or 2^8

36
Q

What are the two data types?

A

1) Primitive

2) Object

37
Q

What is the difference between primitive and object data types?

A

Primitive have no method associated with them.

38
Q

How many primitive data types are there?

A

8
6 Numeric
2 Non-numeric

39
Q

What are the 6 numeric primitive data types?

A
Byte
Short
Int
Long 
Float 
Double
40
Q

How may bits in a “short” data type?

A

16 bits, or 2 bytes

41
Q

How many bits in an “int” data type?

A

32 bits, or 4 bytes

42
Q

How many bits in a “long” data type?

A

64 bits, or 8 bytes

43
Q

How many bits in a “float” data type?

A

32 bits, or 4 bytes

44
Q

How many bits in a “double” data type?

A

64 bits, or 8 bytes

45
Q

What are the 2 default numeric data types?

A

Int and Double

46
Q

How many bits in a “char” data type?

A

16 bits, or 2 bytes

47
Q

How is floating data stored?

A

As a mantissa and an exponent

48
Q

What is the naming convention for constants?

A

UPPER_CASE_LETTERS

49
Q

What keyword is used to declare a constant?

A

final

50
Q

What is a string literal?

A

Surrounding a String of characters with quotation marks (“ “)