Week 5: Basic Syntax Of Java,Java Identifiers,Java Variables,Java Modifiers,Java Enums,,Java Basic Data Types:

•Case Sensitivity - Java is case sensitive, which means identifier Hello and hello would have different meaning in Java.

•Class Names - For all class names the first letter should be in Upper Case. 
If several words are used to form a name of the class, each inner word's first letter should be in Upper Case.
Example class MyFirstJavaClass

Java Identifiers:

 

All Java components require names. Names used for classes, variables and methods are called identifiers.

 

Rules:

•All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore (_).

•After the first character identifiers can have any combination of characters.

•A key word cannot be used as an identifier.

•Most importantly identifiers are case sensitive.

 

Examples of legal identifiers: age, $salary, _value, __1_value

Examples of illegal identifiers: 123abc, -salary

Java Modifiers :

 

Like other languages, it is possible to modify classes, methods, etc., by using modifiers. There are two categories of modifiers:

 

Access Modifiers: default, public , protected, private

Non-access Modifiers: final, abstract, strictfp

Java Basic Data Types:

There are two data types available in Java:

Primitive Data Types

Reference/Object Data Types