Data Types in Java
- Used to represent the type of memory allocation.
- Used with variables and methods.
- These are fixed.
Primitive Data Types
Primitive data types are defined already by the programming
language. In Java there are 8 primitive data types.
Non-Primitive Data Types
Non-Primitive data types are defined by the user. They are
Class, Array, Interface and String.
Naming Conventions in Java
There are few naming conventions defined by the Java language that should be kept in mind while giving name of a class, interface,
- Class and Interface: First letter of each word should be
uppercase. Ex: MyClassName.
- Method: First letter of first word is lowercase while
first letter of other words is uppercase. Ex: myMethodName().
- Package and Keyword: In lowercase. Ex: int, float, static,