Week 1: Introduction to Java and IDEs
Java is a high-level, class-based, object-oriented programming language developed by Sun
Microsystems (now owned by Oracle) in 1995. It is designed to have as few implementation
dependencies as possible, meaning that compiled Java code can run on all platforms that support
Java without the need for recompilation. This feature is called platform independence and is made
possible through the Java Virtual Machine (JVM). Key features of Java include simplicity,
object-oriented structure, platform independence (Write Once, Run Anywhere), security,
robustness, and support for multithreading. Java applications can be of various types: Standalone
applications (e.g., desktop apps), Web applications (e.g., servlets, JSP), Enterprise applications
(e.g., EJB), and Mobile applications (e.g., Android apps). The Java Development Kit (JDK) includes
the Java Runtime Environment (JRE), compiler (javac), and various development tools. Integrated
Development Environments (IDEs) like Eclipse, IntelliJ IDEA, and NetBeans simplify writing,
debugging, and running Java programs.
Week 2: JVM, JDK, JRE, Execution Flow, Data Types
The Java Virtual Machine (JVM) is an abstract machine that enables computers to run Java
programs. It converts Java bytecode (from .class files) into machine-specific code. JDK (Java
Development Kit) is used for developing Java programs and contains tools such as the compiler,
debugger, and JRE. JRE (Java Runtime Environment) is required to run Java programs and
contains the JVM and essential libraries. The execution flow in Java involves writing code (.java),
compiling it to bytecode (.class), and running it on the JVM. Java provides eight primitive data
types: byte, short, int, long, float, double, char, and boolean. These are used for storing raw values
in memory. Operators in Java include arithmetic (+, -, *, /, %), relational (==, !=, >, <), logical (&&, ||,
!), and assignment (=, +=, -=).
Week 3: Classes, Objects, Constructors, Strings
A class in Java is a blueprint for objects and defines their properties (fields) and behaviors
(methods). An object is an instance of a class. Constructors are special methods used to initialize
objects when they are created. They have the same name as the class and no return type. Java
allows method overloading—defining multiple methods with the same name but different parameter
lists. The String class is used to store and manipulate text. Common String methods include
length(), substring(), equals(), indexOf(), and toUpperCase(). Strings are immutable in Java,
meaning once created, their values cannot be changed.
Week 4: Inheritance, Polymorphism, Abstraction, Interface
Inheritance enables one class (child) to acquire fields and methods from another class (parent),
promoting code reuse. Polymorphism means 'many forms' and allows objects to be treated as
instances of their parent class. It includes method overloading (same method name, different
parameters) and method overriding (redefining a method in a subclass). Abstraction is the concept
of hiding implementation details and showing only the functionality to the user. It can be achieved
using abstract classes (contain both abstract and concrete methods) and interfaces (fully abstract).
An interface defines a contract that classes must follow, using the 'implements' keyword. Interfaces
can help achieve multiple inheritance in Java.
Week 5: Exception Handling
Exception handling in Java is managed through try-catch-finally blocks. The try block contains code
that may throw an exception. The catch block handles specific exceptions, and the finally block
executes regardless of an exception. Exceptions are classified as checked (must be handled, e.g.,
IOException) and unchecked (runtime exceptions like ArithmeticException). Custom exceptions can
be defined by extending the Exception class, allowing you to define meaningful application-specific
error messages and logic.
Week 6: File Handling and Serialization
File handling in Java is performed using classes like FileReader, FileWriter, BufferedReader,
BufferedWriter, etc. These classes allow reading from and writing to text files. Serialization is the
process of converting an object into a byte stream, so it can be saved to a file or transmitted over a
network. To serialize an object, it must implement the Serializable interface. Deserialization is the
reverse process, converting a byte stream back into an object.
Week 7: GUI Basics with Swing
Java Swing provides a rich set of GUI components for building graphical applications. Key
components include JFrame (window), JButton (button), JLabel (label), JTextField (text box), etc.
Layout managers such as FlowLayout, BorderLayout, and GridLayout control the arrangement of
these components within containers like JPanel or JFrame.
Week 8: Event Handling
Event handling allows programs to respond to user interactions such as button clicks or mouse
movements. Event listeners (e.g., ActionListener, MouseListener) detect and handle these events.
In Swing, you typically register listeners to components using methods like addActionListener().
Anonymous classes and lambda expressions can simplify event handling.
Week 9: Drag-Drop GUI, Strings
Drag-and-drop GUI design is typically done using IDEs like NetBeans or IntelliJ, allowing
developers to create interfaces visually. Java String class provides many methods to manipulate
text, such as toUpperCase(), substring(), replace(), trim(), etc. Building user forms, menus, and text
editors require effective use of these components and functions.
Week 10: JDBC & Databases
JDBC (Java Database Connectivity) is an API for connecting and executing queries with databases
using Java. Steps include: loading the driver, establishing a connection, creating a statement,
executing SQL, and processing the results. CRUD operations (Create, Read, Update, Delete) are
the foundation of database manipulation.
Week 11: Advanced JDBC
PreparedStatement is used for executing parameterized SQL queries, which helps prevent SQL
injection and improves performance. Transactions in JDBC allow multiple SQL operations to be
executed as a single unit of work. If any operation fails, the entire transaction can be rolled back to
maintain data integrity.
Week 12: Lambda Expressions
Lambda expressions in Java are used primarily to implement functional interfaces (interfaces with a
single abstract method). They provide a concise syntax for writing anonymous methods and
simplify event handling, threading, and iteration. Example: Runnable r = () ->
System.out.println("Running");
Week 13: Multithreading
Multithreading allows concurrent execution of two or more threads for maximum CPU utilization.
Threads can be created by extending the Thread class or implementing the Runnable interface.
Thread states include New, Runnable, Running, Blocked, and Terminated. Java provides methods
like start(), run(), sleep(), join(), and interrupt() for thread control.
Week 14: Network Programming
Java supports network programming using the java.net package. TCP and UDP are two core
transport layer protocols. Socket and ServerSocket classes are used for TCP connections.
DatagramSocket and DatagramPacket are used for UDP communication. These classes enable
creating client-server applications, such as a basic chat program.
Week 15: RMI & Packaging
RMI (Remote Method Invocation) allows objects to invoke methods across the network. It supports
distributed applications by enabling communication between Java programs on different machines.
RMI components include remote interface, implementation class, server, and client. JAR (Java
Archive) files bundle all required class files and resources for deployment. JavaDoc is used to
generate HTML documentation from source code comments.
Week 16: Project Presentation
The final week involves preparing and presenting your course project. This includes demonstrating
the functionality, reviewing code structure, debugging where necessary, and answering questions
about your design and implementation. Peer reviews and instructor feedback help finalize the
submission.