Flat Preloader Icon

Language Fundamentals

Overview

  1. Names used for classes, methods, interfaces
    and variables are called Identifiers
  2. All identifiers must start with either a letter
    or currency character($) or a connecting
    character like underscore(_).
  3. A Java keyword cannot be used as an
    identifier.
  4. Identifiers in Java are case sensitive.

Identifiers

  • Identifiers
  • Variables & Constants
  • Encoding Sets
  • Separators
  • Primitives
  • Primitive Conversion
  • Operators

Variables & Constants

  • Declare variables
  • Assign values to variables.
  • Declare & Initialize
  • Create constants

Encoding Set

  1. ASCII (American Standard Code for
    Information Interchange)
    • Represented in 8 bits and represents all
    English alphabets, punctuations etc.
  2. ISO-8859-1 (International Standards
    Organization)
    8 Bits and contains all characters
    required for all western languages
  3. Unicode
    • Developed by Unicode Consortium
    • Accommodates all characters of all
    languages in world.
    • Uses 16 bits.
  • UTF-8
    Every character is encoded in 1 byte
    Suitable for texts having Latin letters.
  • UTF-16
    Commonly used characters are encoded
    in 2 bytes
    Less common characters are encoded as
    pairs of 16 bit code units.
  • UTF-32
    Uses 32 bits for every single character.
    Not a choice for Internet applications.

Separators

Symbol Uses
. Refer methods/fields of objects
, To separate arguments in method signatures.
; In For loops Terminate Statements
{ } Declare Arrays Blocks
( ) To evaluate Conditions Method signatures to contain lists of arguments. Narrowing conversions.
[ ] Declare Arrays Refer array values
Pass parameters to parameterized types
: In For loops

Primitives

  • byte
  • short
  • int
  • long
  • float
  • double
  • char
  • boolean

Primitive Conversions

  • Widening conversions
    byte to short,int,long, float
    int to long,float,double
    float to double
  • Narrowing Conversions
    short to byte
    int to short, byte
    double to float

Operators

  1. Unary Operators
  2. Arithmetic Operators
  3. Relational & Conditional Operators
  4. Assignment Operators
  5. Logical & Shift Operators
  6. Other Operators
These fundamental concepts are the building blocks of Java programming. Understanding them is essential for writing Java applications effectively and efficiently.