Basic Programming Concepts Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a variable?

A

A label for an area of memory used to store data

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

What is a class?

A

A template for an object

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

How do you declare a variable?

A

State the type and the name of the variable.
e.g.
int num;
String name;

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

How do you initialise a variable?

A

Provide a declared variable with an initial, startup value - often 0 or an empty String. Usually the syntax is in the following format “datatype variablename = value”

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

Why do you need to initialise a variable?

A

To make sure that it has a value that can be evaluated or used.

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