Values and Types
In Java, tokens are basic building blocks put together to construct the programs. A token can be a keyword, identifier, constant, delimiter or an operator. Keywords are the reserved words that convey a special meaning and perform a predefined task. Identifier is a sequence of characters used to denote names of variables, methods and classes. Literals are a sequence of characters that represent constant values to be stored in variables. Literals are often referred to as constants. Punctuators are the separators used to organise the statements. Operators are special symbols or tokens to perform specific tasks on a number of operands.
Data types are used to specify the type of data stored by a variable. They are classified into two types: Primitive data types and Non-Primitive data types. Primitive types are the data types provided by a programming language as basic building blocks. They are also known as built-in types or basic types. Non-Primitive data types are directly or indirectly dependent on primitive data types. They are also known as derived data types. Package is a way to group related class and interface in one unit. It is used to resolve name conflicts between class and names. It can be imported in any program by using import keyword.