Basic Programming Concepts Flashcards
1
Q
What is a variable?
A
A label for an area of memory used to store data
2
Q
What is a class?
A
A template for an object
3
Q
How do you declare a variable?
A
State the type and the name of the variable.
e.g.
int num;
String name;
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”
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.