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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Identifiers

A
  • Identifiers are names given to different parts of the program such as variables, classes, functions, arrays, etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Operators

A

Operators are tokens which perform specific operations on data.

Examples:

  • Arithmetic operators
  • Relational operators
  • Logical operators
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Separators

A
() - parenthesis
{} - curly braces
[] - square brackets
; - semi colon
, comma
. dot
How well did you know this?
1
Not at all
2
3
4
5
Perfectly