KTU OOP Java2024 Scheme • 60M ESE
Visual Learning Hub

20 Examination-Ready Java & OOP Diagrams

Every essential KTU diagram with accurate technical labels, component explanations, step-by-step flow, and exam drawing checklists.

Diagram 1

JVM Architecture

JAVA VIRTUAL MACHINE (JVM) ARCHITECTUREClass Loader Subsystem1. Loading (Bootstrap, Extension/Platform, Application) • 2. Linking (Verify, Prepare, Resolve) • 3. InitializationRUNTIME DATA AREASMethod AreaClass metadata & static (Shared)Heap AreaAll objects & arrays (Shared)JVM StacksFrames & locals (Per Thread)PC RegistersCurrent instr. (Per Thread)Native StacksC/C++ calls (Per Thread)EXECUTION ENGINEInterpreterLine-by-line bytecodeJIT CompilerHot code -> NativeGarbage CollectorReclaims HeapJNINative InterfaceNative LibsOS C/C++ APIs

Internal architecture of the Java Virtual Machine showing how compiled .class bytecode is loaded, stored across Runtime Data Areas, and executed by the Execution Engine.

Diagram 2

Java Program Compilation and Execution

Source CodeProgram.javaJava Compilerjavac Program.javaBytecode (.class)Platform Independent (WORA)Windows JVMInterpreter/JIT -> x64 MachineLinux JVMInterpreter/JIT -> ELF MachinemacOS JVMInterpreter/JIT -> ARM64/x64Compile Time (Once)Runtime (Anywhere)

Two-stage hybrid compilation and interpretation flow demonstrating Write Once, Run Anywhere (WORA) across Windows, Linux, and macOS.

Diagram 3

OOP Concepts (Four Pillars)

OOP ParadigmClasses (Templates) & Objects (Instances)1. EncapsulationBind data + methods; private hiding2. AbstractionExpose essential; hide details3. InheritanceSubclass reuses Superclass (IS-A)4. PolymorphismOne interface, many forms

Visual overview of the four core pillars of Object-Oriented Programming surrounding Class & Object decomposition.

Diagram 4

Class and Object Relationship (Stack & Heap)

Class: Student (Blueprint)Stored once in Method Areaint rollNo;String name;void display() {...}STACK (References)s1Ref: 0x104As2Ref: 0x208CHEAP (Objects via new)Student Object @ 0x104ArollNo = 101, name = "Asha"Student Object @ 0x208CrollNo = 102, name = "Kiran"

Illustrates how a Class acts as a blueprint, how reference variables live on the Stack, and how new allocates distinct Object instances on the Heap.

Diagram 5

Types of Inheritance in Java

1. SingleClass AClass B2. MultilevelBoxBoxWeightShipment3. HierarchicalPersonStudentTeacher4. Multiple (Interface Only)<<int>> A<<int>> BClass Cimplements A, BClass C extends A, BILLEGAL (Diamond Ambiguity)Arrows point from Subclass to Superclass (extends = solid, implements = dashed)

Comparison of Single, Multilevel, and Hierarchical inheritance supported by Java classes, alongside Multiple and Hybrid inheritance (disallowed for classes, achieved via interfaces).

Diagram 6

Constructor Execution Order in Inheritance

1. Box() [Superclass]Executes body FIRST2. BoxWeight() [Subclass 1]Calls super(), executes SECOND3. Shipment() [Subclass 2]Calls super(), executes LASTPhase 1: super() Calls UpwardPhase 2: Execution Top-Down

Demonstrates the invocation vs completion order in a multilevel hierarchy (Box -> BoxWeight -> Shipment): calls chain upward via super(), while constructor bodies execute top-down from superclass to subclass.

Diagram 7

Dynamic Method Dispatch (Runtime Polymorphism)

Superclass ReferenceA r; (Compile-time type: A)Object of A (r = a)Calls A.callme()Object of B (r = b)Calls B.callme() [Overridden]Object of C (r = c)Calls C.callme() [Overridden]JVM RuntimeSelects method by Object type, NOT Ref type

Shows how a single superclass reference variable (Figure ref or A r) points to different subclass objects at runtime, causing the JVM to select the overridden method dynamically based on the actual object type.

Diagram 8

Package Directory Structure & Access Scope

CLASSPATH Root (./classes)java -cp ./classes p1.Derivedpackage p1/ (Folder)Same-package default + protected visiblepackage p2/ (Folder)Needs import p1.*; only public/protectedProtection.classbase classDerived.classextends ProtectionProtection2.classsubclass in p2OtherPkg.classnon-subclass in p2

Illustrates how Java maps dot-separated hierarchical package names (com.ktu.oop) directly to nested OS file system directories and how CLASSPATH locates root packages.

Diagram 9

Java Exception Class Hierarchy

java.lang.Objectjava.lang.ThrowableRoot of all errors & exceptionsExceptionProgram-recoverable conditionsError (Unchecked)JVM failure: StackOverflowError, OutOfMemoryErrorChecked ExceptionsIOException, SQLException, FileNotFound, ClassNotFoundRuntimeException (Unchecked)ArithmeticException, NullPointer, ArrayIndexOutOfBounds

Complete java.lang.Throwable class tree partitioning runtime issues into Error (unchecked JVM failures) and Exception (Checked vs RuntimeException Unchecked).

Diagram 10

Exception Handling Execution Flow

try BlockRisky code executesException?Thrown at runtime?YESNOMatch catch()First matching handler runsSkip catch()Normal path continuesfinally BlockALWAYS executes (cleanup)

Control-flow decision diagram showing how execution branches through try, matching catch handlers, finally cleanup, or default JVM termination.

Diagram 11

Singleton Design Pattern

Client ACalls getInstance()Client BCalls getInstance()Singleton- static instance: Singleton- Singleton() // private!+ static getInstance()Creates object ONCE if nullSingle Heap InstanceclientA == clientB (true)

Structural & UML diagram of the Singleton creational pattern ensuring only one shared instance exists across the JVM with a global access point.

Diagram 12

Adapter Design Pattern

ClientExpects Target<<interface>> Targetplay(type, file)Adapterimplements Target + translatesAdapteeIncompatible APIAdapter wraps Adaptee (has-a) and exposes Target interface to Client

Structural UML diagram showing how an Adapter wraps an incompatible Adaptee and translates requests from a Target interface expected by the Client.

Diagram 13

SOLID Principles Overview

S – SRPSingle Responsibility1 reason to changeO – OCPOpen / ClosedExtend via interfacesL – LSPLiskov SubstitutionSubtypes safe swapI – ISPInterface SegregationSmall role interfacesD – DIPDependency InversionDepend on abstractions

Visual summary of Robert C. Martin's five SOLID object-oriented design principles that eliminate rigid, fragile, and tightly coupled code.

Diagram 14

AWT and Swing Component Hierarchy

java.lang.Objectjava.awt.Componentjava.awt.ContainerWindow -> Frame / DialogHeavyweight Top-Level ParentsJFrame, JDialog, JWindowTop-Level Containers (Contain JRootPane)javax.swing.JComponentLightweight Swing Controls & JPanelJLabel / JPanelPassive / ContainerJTextComponent-> JTextFieldAbstractButtonJButton, JCheckBox...

Class inheritance tree showing how Swing builds upon AWT's Component and Container while splitting lightweight JComponent controls from heavyweight top-level containers (JFrame, JDialog).

Diagram 15

MVC & Swing Model-Delegate Architecture

Classic 3-Part MVCModelState & DataViewScreen RenderControllerUser InputSwing Model-Delegate (Separable Model)ModelButtonModel / DocumentUI DelegateView + Controller (ComponentUI)Enables Pluggable Look & Feel

Side-by-side illustration of classic 3-part Model-View-Controller (MVC) and Swing's adapted Model-Delegate (Separable Model) architecture that merges View + Controller into the UI Delegate.

Diagram 16

Delegation Event Model

User ActionClick / KeypressEvent Sourcee.g., JButton (addActionListener)Event ObjectActionEvent (src, cmd)Event Listenerimplements ActionListenerStep 1: Register Listener (source.addActionListener(listener))

Core interaction diagram of Java's Delegation Event Model showing Event Source registration, Event Object generation, and selective notification to registered Listeners.

Diagram 17

Swing Event Handling Sequence on EDT

1. main() ThreadSwingUtilities.invokeLater()2. Event Dispatch ThreadCreates JFrame & reads Queue3. Source -> EventFires ActionEvent on click4. Listener RunsUpdates UI safely on EDTAll Swing creation & event handlers execute on the single Event Dispatching Thread (EDT)

End-to-end runtime sequence showing how Swing initializes UI on the Event Dispatching Thread (EDT) and dispatches OS user input through the event queue to listener callbacks.

Diagram 18

Swing Layout Managers Visual Guide

FlowLayoutLeft-to-right wrapBorderLayoutNORTHCENTERSOUTH5 regions (JFrame default)GridLayoutEqual-size cells (r × c)CardLayoutActive Card1 card visible at onceGridBagLayoutMulti-cell constraints

Visual blueprint of all five syllabus Layout Managers (FlowLayout, BorderLayout, GridLayout, CardLayout, GridBagLayout) showing component arrangement rules.

Diagram 19

JDBC Architecture (2-Tier, 3-Tier & Driver Types)

JDBC Layered ArchitectureJava ApplicationCalls java.sql.* interfacesJDBC API + DriverManagerApp-to-DriverManager layerJDBC Driver API & Drivers (Types 1–4)DriverManager-to-Driver layerMySQL / OraclePostgreSQL DBProcessing ModelsTwo-Tier (Direct Client-Server)Java ClientJDBC DriverDBMSThree-Tier (Via Middle Application Server)Client UIApp Server+ JDBC DriverDBMS

Architecture layers of JDBC showing the Java Application, JDBC API, DriverManager, JDBC Driver API, and Two-Tier vs Three-Tier database access models.

Diagram 20

6-Step JDBC Connectivity Execution Sequence

1. Import java.sql.*Load JDBC API interfaces2. Register DriverClass.forName(...) / SPI Auto3. Open ConnectionDriverManager.getConnection()4. Execute StatementcreateStatement().executeQuery()5. Read ResultSetwhile (rs.next()) rs.getXXX()6. Clean Up Resourcesrs.close(), stmt.close(), conn.close()

Sequential flowchart of the six conceptual JDBC steps from importing java.sql.* to closing database resources.