SCJP Lecture on Language Fundamentals

Jul 20, 2024

SCJP Lecture on Language Fundamentals

Introduction

  • Focus on Language Fundamentals
  • Keep submitting assignments on Language Fundamentals

Key Concepts

1. Keywords

  • Reserved words in Java
  • Examples: int, boolean, class, etc.

2. Identifiers

  • Names given to elements such as classes, methods, and variables
  • Rules:
    • Must begin with a letter (A-Z, a-z), dollar sign $, or underscore _
    • Subsequent characters can be letters, digits, dollar signs, or underscores
    • Case-sensitive
    • Cannot use Java reserved words

3. Data Types

  • Primitive Data Types: byte, short, int, long, float, double, char, boolean
  • Non-Primitive Data Types: Objects, Arrays

4. Variables

  • Containers that hold data
  • Types of variables: local, instance, and static

5. Literals

  • Fixed values assigned to variables
  • Types: Integer, Floating-point, Character, String, Boolean

6. Arrays

  • Collection of similar type elements
  • Declaration: datatype[] arrayName;
  • Instantiation: arrayName = new datatype[size];

Summary

  • Understand and use keywords, identifiers, and data types.
  • Properly declare and initialize variables and arrays.
  • Submit assignments on time.