1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Revise later
SpaceTo flip
If confident
All Flashcards
What is an 'int'?
A primitive data type that stores whole numbers.
What is a 'double'?
A primitive data type that stores decimal numbers with high precision.
What is a 'boolean'?
A primitive data type that stores a truth value: either 'true' or 'false'.
What is a 'variable'?
A named storage location in memory that holds a value.
What is 'scope' in Java?
The region of the program where a variable is accessible.
What is 'initialization'?
Giving a variable its first value.
What is 'Integer Overflow'?
When an integer exceeds its maximum or minimum allowed value, wrapping around to the other end.
What does 'strongly typed' mean?
Once a variable has a data type, it cannot be changed to a different data type.
What is 'public' access modifier?
Accessible everywhere.
What is 'private' access modifier?
Accessible only within the class.
What are the differences between 'int' and 'double'?
int: Stores whole numbers | double: Stores decimal numbers with higher precision.
What are the differences between 'public' and 'private' access modifiers?
Public: Accessible everywhere. | Private: Accessible only within the class.
What is the range of an 'int'?
-2,147,483,648 to 2,147,483,647
Why are phone numbers stored as Strings?
Because they are not numerical values used in calculations.
What is Camel Casing?
A naming convention where the first word is lowercase, and subsequent words start with an uppercase letter (e.g., myVariableName).
What are reserved words?
Keywords in Java that cannot be used as variable names (e.g., int, class, public).
What happens during integer overflow?
The value wraps around to the opposite end of the integer range.
What are access modifiers?
Keywords that control the visibility or accessibility of a variable or method.
What is the purpose of variable declaration?
To specify the name and data type of a variable before it can be used.
What is the difference between declaration and initialization?
Declaration creates the variable; initialization assigns it a value.
Why is data type important in Java?
Java is strongly typed, so the data type determines what kind of values a variable can hold and what operations can be performed on it.
What is the default access modifier?
Accessible within the package.