Java fundamentals Flashcards
1
Q
JAVA Character Set
A
Character set is a set of valid characters that a language can recognise.
A character represents any letter, digit or any other sign.
Java uses the Unicode character set.
Unicode is a character coding scheme that has character codes for numbers, arithmetic symbols, special characters and for the letters in almost all the languages in the world.
2
Q
Tokens
A
The smallest individual unit in a program is known as a token.
Java has the following tokens:
- Keywords
- Identifiers
- Literals
- Operators
- Separators
3
Q
Keywords
A
- Keywords are reserved words.
- Keywords are words that convey special meaning to the compiler.
- THey aer not to be used as names of variablres.
4
Q
Identifiers
A
- Identifiers are names given to different parts of the program such as variables, classes, functions, arrays, etc.
5
Q
Identifier forming rules of Java
A
- Can have alphabets, digits, underscores and dollar sign.
- Must not be a keyword, Boolean literal(like true and false) or null literal(like null)
- Must not begin with a digit.
- Java is case sensitive i.e upper-case letters and lower case letters are treated differently.
- Must not have spaces.
6
Q
Literals
A
- Literals are data items that have fixed data values.
- Types:
- Integer literals
- Floating literals
- Boolean literals
- Character literals
- String literal
- Null literal
7
Q
Operators
A
Operators are tokens which perform specific operations on data.
Examples:
- Arithmetic operators
- Relational operators
- Logical operators
8
Q
Separators
A
() - parenthesis {} - curly braces [] - square brackets ; - semi colon , comma . dot