2.3 Data types
2.3 Data types
Outline
Java is a strongly typed language. This means that every variable must have a
declared type. There are eight primitive types in Java.
● Four integer types
○ byte, short, int, long
● Two floating-point number types
○ float (6-7 decimal digits)
○ double(15 decimal digits)
● one character type
● one a boolean type
Rules of Identifiers
Identifiers in Java are names that identify elements such as classes, variables, and
methods in a program. In other words, an identifier is one that is for naming variables,
user-defined methods, classes, objects, parameters, labels, packages, and interfaces in a
program.
Oracle Documentation
Note: Using $ sign for variable naming is not recommended by oracle.
Comment types
● Packages ● camelCase
● Classes ● PascalCase
● Interfaces ● snake_case
● Methods ● kebab-case
● Variables ● MACRO_CASE
● Constants ● Train-Case
Oracle Documentation
Interview Questions
The only thing standing between you and outrageous
success is continuous progress.