JAVA: Programming in Java

Programming in Java: week-wise syllabus, notes, short notes, and available revision material.

Ctrl K
11 resources in this course · 12 syllabus weeks

Programming in Java

Diploma

Complete week-wise syllabus

Java · 12 weeks

Week 1: Basic Object-Oriented Programming – Class Hierarchy

Topics covered

  • Introduction to Java and OOP
    • Basic structure of Java program.
    • Concept of classes and objects.
    • Difference between procedural programming and object-oriented programming.
  • Classes and objects
    • Understanding class as a blueprint.
    • Object creation.
    • Instance variables and methods.
    • Introduction of constructors.
  • Encapsulation
    • Organizing data and methods into a single unit.
    • Access modifiers: public, private, protected.
    • Getters and setters.
  • Class hierarchy
    • Relationships between classes.
    • Introduction of superclass and subclass.
    • Representing inheritance hierarchy.
  • Interface and implementation
    • Concept of public interface.
    • Hiding internal implementation details.

Expected skills:

  • Creating Basic Java classes and objects.
  • Implementing constructors and instance methods.
  • Using Encapsulation.
  • Understanding and designing class hierarchy.
Week 2: Basic Object-Oriented Programming – Inheritance and Overriding

Topics covered

  • Inheritance
    • Concept of code reuse.
    • extends keyword.
    • Parent and child classes.
    • Inherited fields and methods.
  • Method overriding
    • Redefining the method of parent class in subclass.
    • @Override annotation.
    • Difference between overriding and overloading.
  • Constructor behavior
    • Superclass constructor invocation.
    • super keyword.
    • Constructor chaining.
  • Access control in inheritance
    • Accessibility of inherited members.
    • Behavior of private and protected members.
  • Inheritance design
    • Is-a relationship.
    • When is inheritance useful and when should it be avoided?

Expected skills:

  • Creating class hierarchy using inheritance.
  • Overriding methods.
  • Understanding the use of super keyword.
  • Differentiate overloading and overriding.
Week 3: Basic Object-Oriented Programming – Polymorphism

Topics covered

  • Polymorphism
    • One interface, multiple implementations.
    • Concept of compile-time and runtime polymorphism.
    • Dynamic method dispatch.
  • Upcasting and downcasting
    • Accessing subclass object from superclass reference.
    • Reference type and actual object type.
    • Safe casting and instanceof.
  • Polymorphic method calls
    • Overridden method selection at runtime.
    • Understanding method behavior based on object type.
  • Subtype relationships
    • Supertype and subtype.
    • Concept of substitutability.
    • Generalized methods and reusable code.
  • Polymorphism in design
    • Handling different object types through common interface.
    • Extensible class hierarchies.

Expected skills:

  • Understanding polymorphic references and method calls.
  • Runtime method dispatch tracing.
  • Solving cases of upcasting and downcasting.
  • Writing reusable code with polymorphism.
Week 4: Basic Object-Oriented Programming – Abstract Classes

Topics covered

  • Abstraction
    • To expose essential behavior.
    • Hiding implementation details.
    • Difference between abstraction and encapsulation.
  • Abstract classes
    • abstract keyword.
    • Abstract methods and concrete methods.
    • Not being able to directly create object of Abstract class.
  • Concrete subclasses
    • Implementing abstract methods.
    • Inheritance from Abstract class.
    • Defining subclass-specific behavior.
  • Abstract classes vs interfaces
    • Use of abstract class.
    • Basic concept of interface.
    • Difference between common behavior and common contract.
  • Class design
    • Generalized parent classes.
    • Specialized subclasses.
    • Reusable object-oriented architecture.

Expected skills:

  • Implementing abstract classes and methods.
  • Differentiating abstract and concrete classes.
  • Applying abstraction in class hierarchy.
  • Designing suitable superclass and subclasses for the given problem.
Week 5: Collections and Iterators

Topics covered

  • Java Collections Framework
    • Purpose of collections.
    • Difference between Collection and array.
    • Common collection types.
  • Lists
    • Introduction of ArrayList and LinkedList.
    • To add, remove and retrieve elements.
    • Index-based access.
  • Sets
    • Behavior of duplicate elements.
    • Overview of HashSet and TreeSet.
    • Storing unique elements.
  • Maps
    • Key-value pairs.
    • Introduction of HashMap.
    • Operations on keys and values.
  • Iterators
    • Iterator interface.
    • hasNext() and next().
    • Collection traversal.
    • Removing elements through iterator.
  • Collection traversal
    • Enhanced for loop.
    • Comparison of iterator and index-based traversal.

Expected skills:

  • Choosing suitable collection type.
  • Perform basic operations on lists, sets and maps.
  • Traversing a collection with iterators.
  • To trace collection behavior and iteration output.
Week 6: Generics and Callbacks

Topics covered

  • Generics
    • Generic classes and methods.
    • Type parameters.
    • Compile-time type safety.
    • Generic collections.
  • Generic methods
    • Type parameter declaration.
    • Generic method invocation.
    • Basic concept of type inference.
  • Bounded type parameters
    • Upper bounds using extends.
    • Restrictions on generic types.
    • Generics with subtype relationships.
  • Wildcards
    • ? wildcard.
    • Upper-bounded and lower-bounded wildcards.
    • Generic type compatibility.
  • Callbacks
    • Concept of Callback.
    • Passing methods as behavior.
    • Introduction of functional interfaces.
    • Basic use of lambda expressions.
  • Generics and callbacks together
    • Reusable algorithms.
    • Examples of collection processing.

Expected skills:

  • Writing generic classes and methods.
  • Interpreting type parameters and wildcards.
  • Understanding generic type compatibility.
  • Using simple callbacks and lambdas.
Week 7: Cloning, I/O Serialization and Packages

Topics covered

  • Cloning
    • Concept of object copying.
    • Shallow copy and deep copy.
    • Overview of the Cloneable interface and clone().
    • Understanding the behavior of references and copied objects.
  • Input and output
    • Introduction of Java I/O.
    • Input and output streams.
    • Byte streams and character streams.
    • Reading and writing files.
  • Serialization
    • Converting objects to byte stream.
    • Serializable interface.
    • Serialization and deserialization.
    • Basic idea of transient keyword.
  • Packages
    • Purpose of package.
    • Organizing classes.
    • package and import statements.
    • Access control and packages.
  • Program organization
    • Organizing multiple classes into files.
    • Reusable code structure.

Expected skills:

  • Understanding the behavior of object copying.
  • To perform basic file input-output.
  • Explaining the workflow of serialization and deserialization.
  • Creating and importing packages.
Week 8: Cloning, I/O Serialization and Packages – Continued

Topics covered

  • Advanced cloning concepts
    • Nested object references.
    • Side effects of shallow copy.
    • Need for deep copy.
    • Copy constructors and alternative copying approaches.
  • I/O operations
    • Practical examples of file handling.
    • Concept of buffered input-output.
    • To close the streams properly.
    • Resource management.
  • Serialization details
    • Saving object state.
    • Object reconstruction.
    • Basic idea of serialization compatibility.
  • Packages and access
    • Package-level access.
    • Public classes and members.
    • Package structure and naming conventions.
  • Integration
    • File handling with OOP classes.
    • Persisting object data.
    • Multi-class Java program organization.

Expected skills:

  • Analyzing cases of shallow and deep copying.
  • Understanding streams and buffering in file handling.
  • Saving and restoring serializable objects.
  • Organizing programs with multiple packages and classes.
Week 9: Exception Handling

Topics covered

  • Errors and exceptions
    • Runtime errors and exceptions.
    • Exception hierarchy.
    • Throwable, Exception and Error.
  • Exception handling
    • try and catch.
    • Multiple catch blocks.
    • finally block.
    • Exception propagation.
  • Checked and unchecked exceptions
    • Compile-time exception checking.
    • Checked exceptions.
    • Runtime exceptions.
    • throws declaration.
  • Throwing exceptions
    • throw keyword.
    • throws keyword.
    • Custom exceptions.
  • Resource management
    • try-with-resources.
    • Resource cleanup.
    • Exception safety in file handling.
  • Exception design
    • Meaningful error messages.
    • Handling exceptions appropriately.
    • Graceful failure.

Expected skills:

  • Writing try-catch-finally blocks.
  • Differentiating checked and unchecked exceptions.
  • Exception propagation tracing.
  • Creating custom exceptions.
  • Developing robust Java programs.
Week 10: Concurrent Programming

Topics covered

  • Introduction to concurrency
    • Sequential and concurrent execution.
    • Difference between process and thread.
    • Use cases of concurrency.
  • Threads
    • Concept of Thread.
    • Thread class and Runnable interface.
    • Thread creation and execution.
    • Overview of Thread lifecycle.
  • Race conditions
    • Shared data.
    • Concurrent access problems.
    • Nondeterministic execution.
  • Synchronization
    • Critical sections.
    • synchronized methods and blocks.
    • Mutual exclusion.
  • Locks
    • Purpose of lock.
    • Shared resource access control.
    • Synchronization through data consistency.

Expected skills:

  • Writing basic multithreaded Java programs.
  • Identifying race conditions.
  • Understanding the use of Synchronization.
  • Analyzing possible outputs of concurrent execution.
Week 11: Concurrent Programming – Continued

Topics covered

  • Thread coordination
    • Coordination between multiple threads.
    • Waiting and notification.
    • Basic behavior of wait(), notify() and notifyAll().
  • Monitors
    • Concept of Monitor.
    • Mutual exclusion and condition synchronization.
    • Controlled access to shared resources.
  • Semaphores
    • Purpose of Semaphore.
    • Permits and resource access.
    • Concept of binary and counting semaphore.
  • Deadlocks
    • Deadlock conditions.
    • Circular waiting.
    • Examples of deadlock.
    • Basic ideas of prevention and avoidance.
  • Concurrency correctness
    • Thread safety.
    • Race conditions and synchronization errors.
    • Safe management of shared state.

Expected skills:

  • To understand thread coordination mechanisms.
  • Explaining the difference between locks, monitors and semaphores.
  • Identifying deadlock situations.
  • Tracing the synchronization behavior of concurrent programs.
Week 12: Concurrent Programming – Continued

Topics covered

  • Advanced synchronization
    • Multiple shared resources.
    • Locking strategies.
    • Synchronization overhead.
  • Concurrent access control
    • Protecting shared data.
    • To prevent race conditions.
    • Designing critical sections.
  • Concurrent programming patterns
    • Concept of producer-consumer problem.
    • Resource sharing.
    • Thread coordination patterns.
  • Concurrency design
    • Trade-offs of correctness and performance.
    • Overview of deadlock and starvation.
    • Analysis of concurrent program behavior.
  • Course integration
    • Concurrency with OOP.
    • Exception handling in multithreaded programs.
    • Safe and maintainable program design.

Expected skills:

  • Managing shared resources safely.
  • Selecting Synchronization mechanisms.
  • Understanding problems like producer-consumer.
  • Analyzing correctness issues in concurrent programs.

Quick revision map

Java topic distribution

Weeks 1–4: OOP fundamentals

4 weeks

Classes, hierarchy, inheritance, overriding, polymorphism, abstraction

Weeks 5–6: Collections and reusable programming

2 weeks

Collections, iterators, generics, callbacks

Weeks 7–8: Cloning, I/O and packages

2 weeks

Object copying, file handling, serialization, packages

Week 9: Exception handling

1 week

Try-catch, exception hierarchy, custom exceptions

Weeks 10–12: Concurrent programming

3 weeks

Threads, synchronization, locks, monitors, semaphores, deadlocks

OOP: Output-based questions on inheritance, overriding, polymorphism and abstract classes.

Collections and generics: Iterator behavior, collection operations, type compatibility and generic methods.

Cloning and serialization: Shallow vs deep copy, object references and serialization behavior.

Exception handling: Exception flow, checked vs unchecked exceptions, finally and throw/throws.

Concurrency: Thread interleavings, synchronization, locks, semaphores, monitors and race conditions.

IIT Madras official course page