Introduction to Java & OOP
Starts from absolute zero: how Java compiles and runs on the JVM, primitive types & wrappers, arrays, strings, Vector, operators, control flow, methods/varargs, core OOP paradigms, microservices basics, and building objects with constructors and this.
this keyword.Section 1: Introduction to Java
Introduction to Java, Features (Buzzwords) & Naming Conventions
Before writing a single line of Java, you need to understand what Java actually is and why industries trust it for everything from Android apps and banking servers to big-data engines. Unlike older languages tied to a single operating system or CPU, Java was engineered as both a programming language and a software platform so that code written once can run safely anywhere.
Structure of a Simple Java Program, CLI Compilation, PATH & JDK vs JRE vs JVM
Every Java application—from a three-line exam snippet to a banking backend—follows a strict structural skeleton and passes through two distinct phases: compilation (javac) and runtime execution (java). Understanding what each keyword in public static void main(String[] args) does and how JDK, JRE, and JVM relate guarantees easy 3-mark and 6-mark theory points.
Java Virtual Machine (JVM) Architecture & Complete Execution Process
The Java Virtual Machine (JVM) is the heart of Java's portability, memory safety, and performance. In KTU examinations, 'Draw and explain the architecture of JVM' is a cornerstone 6-mark or 9-mark Part B question. Knowing the three major subsystems—Class Loader, Runtime Data Areas, and Execution Engine—gives you full clarity on how Java actually executes in memory.
Variables, Literals, 8 Primitive Data Types & Overflow/Underflow
Java is a strongly typed language: every variable must declare its exact data type before use so the compiler can catch mismatched data early and allocate exact memory. Mastering Java's 8 primitive types, variable scopes (local, instance, static), and literals prevents countless bugs in code-tracing exam questions.
Type Casting (Widening & Narrowing), Type Promotion, Wrapper Classes & Autoboxing
Frequently, programs need to mix data types—say storing an int inside a double, squeezing a double into an int, or storing primitive numbers inside collections like Vector or ArrayList that only accept objects. Java solves this cleanly with two mechanisms: Type Casting (Widening/Narrowing) and Wrapper Classes (Autoboxing/Unboxing).
Arrays in Java: 1D, 2D, Jagged Arrays & Traversal
When you need to store marks for 60 students or represent a 3×3 matrix, creating 60 separate variables is impossible to maintain. Java arrays store fixed-size collections of elements of the same type under a single name—and importantly, in Java, every array is itself an object stored dynamically on the Heap!
Strings (Immutability & Methods) and the Vector Class
Text handling and resizable storage appear in almost every Java program. Unlike C where strings are raw char[] arrays ending in '\0', Java models strings as immutable java.lang.String objects packed with rich manipulation methods. And when you need an array that grows automatically at runtime, Java provides java.util.Vector.
Operators in Java, Bitwise/Shift Operators, Precedence & Associativity
Operators tell the JVM what computation or decision to perform on variables. In KTU exams, operators frequently appear in two forms: (1) explaining specialized Java operators like unsigned right shift (>>>) and short-circuit logical (&&, ||) vs bitwise (&, |), and (2) tracing tricky mixed expressions using operator precedence and associativity.
Control Statements: Selection, Iteration (incl. For-Each) & Jump Statements
Normally Java executes statements strictly top-to-bottom. Control statements give your program intelligence—allowing it to make decisions (Selection), repeat tasks (Iteration), or alter loop/method flow non-linearly (Jump).
Functions/Methods, Command-Line Arguments & Varargs (Variable-Length Arguments)
Breaking code into reusable methods keeps programs modular. Java also provides two flexible ways to pass input into methods: Command-Line Arguments (passing startup data into main from the terminal) and Varargs (letting any method accept zero, one, or many arguments of the same type without manually creating an array).
Overview of Classes, Abstract Classes & Interfaces
Module 1 concludes its Java foundations by introducing the three primary structural blueprints of Java programs: Concrete Classes, Abstract Classes, and Interfaces. While Modules 2 and 3 explore inheritance and interface hierarchies in full depth, understanding what separates these three constructs right now lets you read any Java program clearly.
Section 2: Object-Oriented Programming Concepts
Introduction to OOP, Class as an ADT & Procedural vs Object-Oriented Programming
Before OOP became the industry standard, large programs written in procedural languages (like C) often turned into fragile tangled webs of global variables and functions. Object-Oriented Programming (OOP) restructures software around interacting real-world objects that protect their own data—making massive systems understandable, modular, and reusable.
The Four Pillars of OOP: Abstraction, Encapsulation, Inheritance & Polymorphism
The four pillars—Abstraction, Encapsulation, Inheritance, and Polymorphism—are the heart of the entire OOPS syllabus. Virtually every remaining topic in Modules 2, 3, and 4 (private, extends, abstract, interface, overloading, dynamic dispatch) directly implements one of these four pillars.
Introduction to Microservices: Architecture, Characteristics & Monolith vs Microservices
Modern large-scale Java software rarely runs as one giant single executable file anymore. While OOP organizes code cleanly inside an application using objects and interfaces, Microservices Architecture applies the same philosophy (single responsibility, loose coupling, encapsulation of private data) at the system deployment level. Since this topic appears explicitly in Module 1 of the KTU 2024 syllabus, prepare it carefully for 3-mark and 6-mark questions!
Section 3: Object-Oriented Programming in Java
Declaring Objects, Object References, `new` Operator & Method Invocation
Defining a class creates only a logical blueprint—no memory is reserved for student records or bank accounts until you instantiate objects. Understanding the crucial two-step distinction between declaring an object reference variable and allocating an actual Heap object with new unlocks how Java handles references, aliasing, and method calls.
Constructors in Java: Default, No-Arg, Parameterized, Copy & Constructor Overloading
Creating an object with uninitialized zero values and then calling setData() separately is error-prone—what if a programmer forgets to call setData()? Java solves this with Constructors: special initialization routines that run automatically the instant an object is born with new.
Access Modifiers (`public`, `private`, `protected`, `default`) & the `this` Keyword
Access modifiers are Java's security guards—controlling which classes can read or modify your fields and methods. Meanwhile, the **this keyword** is an object's self-reference, allowing methods and constructors to resolve variable shadowing, chain constructors cleanly, and pass or return the current object itself.