Page 58 - iPro_trackGPT_V5_Class8
P. 58
Identifiers cannot contain special symbols such as!, @, #, %, etc.
Identifiers are case-sensitive, so 'name' and 'NAME' are considered different.
Examples of valid identifier names include Student1, total_amount, userProfile, GradeA, and
count.
Examples of invalid identifier names include the 1st student, @total, 123, grade#, and
student-name.
Keywords
In Java, keywords are special reserved words that have a predefined meaning and cannot serve
as identifiers. The Java language syntax incorporates them for specific operations. Some of the
Java keywords are given below:
Java Keywords
abstract class final interface static
assert const float long switch
boolean continue for new this
break default if private throw
byte do implements protected throws
case double import public try
catch else instanceof return void
char extends int short while
The keyword const cannot be used in Java.
There are three more reserved words in Java: true, false, and null. Technically, they are literal
values and not keywords. However, they cannot be used as identifiers, and they have a specific
meaning to the Java compiler.
Data Types
A data type tells you what type of value a variable can store and how much space it will take. In
Java, there are two main types of data types: primitive and non-primitive.
Primitive Data Types
A primitive data type is a basic, built-in data type in Java that holds simple values like numbers,
characters, and true or false values.
The following table lists the eight fundamental data types that Java offers:
Data Type Size (in bits) Minimum Value Maximum Value
byte 8 –128 127
short 16 –32768 32767
int 32 –2147483648 2147483647
long 64 –9223372036854775808 9223372036854775807
char 16 0 65535
float 32 1.4E –45 3.4028235E38
56 TrackGPT iPRO (V5.0)-VIII

