Programming Basics Flashcards

1
Q

What does the term ‘white space’ mean?

A

The term white space refers to one of more consecutive space characters, tab characters, or line breaks.

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

What is a block?

A

A block is a group of one or more statements that’s enclosed in braces.

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

What is an identifier?

A

An identifier is a word that you make up to refer to a Java programming element by name.

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

What is the state of an object?

A

The state of an object consists of any data that the object might be keeping track of.

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

What is the behavior of an object?

A

The behavior of an object consists of actions that the object can perform.

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

What does the static keyword mean?

A

It means that you can call a method without first creating an instance of a class, because static methods are called from classes, not objects.

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

Creating an object from a class

A

ClassName variableName = new ClassName(Paramater-list);

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

Importing Java classes.

A

import package.class.method;

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

What is a class variable?

A

A class variable is a variable that any method in a class can access, including static methods such as main.

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

What is a local variable?

A

A local variable is a variable that’s declared within the body of a method.

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

What is a final variable?

A

A final variables, also called a constant, is a variable whose value you can’t change after it’s been intialized. To declare a final variable you must use the final keyword. Ex) final int WEEKDAYS = 5;

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

What are primitive types?

A

Primitive types are the data types defined by the language itself.

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

What are reference types?

A

Reference types are types defined by classes in the Java application programming interface, or by classes you create rather than by the language itself.

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

What is an integer?

A

An integer is a whole number that is, a number with no fractional or decimal portion.

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

What value can an integer hold?

A

Any value from -2 billion to +2 billion

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

What value can a byte hold?

A

Any valye from -128 to +128

17
Q

What value can a short hold?

A

Any value from -32,687 to +32.687

18
Q

What value can a long hold?

A

Any value from -9,000 trillion to +9,000 trillion

19
Q

How many decimal points can a float type hold?

A

6 to 7 decimal points

20
Q

How many decimal points can a double hold?

A

Aboout 15 digits

21
Q

Primitive Data Types

A

int, short, long, byte, float, double, char, boolean

22
Q

What is a decrement operator?

A

– subtracts 1 from the value

23
Q

What is an increment operator?

A

++ adds 1 to the value

24
Q

What is a while loop?

A

A loop that executes continuously as long as some conditional expression evaluates to true

25
Q

What is a do-while loop?

A

A do-while loop is similar to a while loop, but with a critical difference: In a do-while loop, the condition that stops the loop isn’t tested until after the statements in the loop have been executed.