Object-Oriented Programming with Java
Overview
Java is a versatile and widely-used programming language, making it an excellent choice for learning object-oriented programming (OOP). This course begins with foundational procedural programming concepts and quickly transitions to the OOP paradigm. Key topics include:
- Class creation and object instantiation.
- Method and constructor overloading.
- Arrays and Java Collections.
- Core OOP principles: encapsulation, inheritance, and polymorphism.
- Access modifiers: public, protected, and private.
- Abstract classes, interfaces, and exception handling.
- Unit testing and software engineering principles.
Additionally, the course introduces essential software engineering methodologies, such as Test-Driven Development (TDD), and explores fundamental data structures like stacks, queues, hash tables, and lists.
Course Aims
This course aims to provide an introductory yet comprehensive understanding of object-oriented programming using Java. Key aims include:
- Developing a solid foundation in OOP principles such as encapsulation, inheritance, and polymorphism.
- Learning Java syntax and programming constructs.
- Gaining practical experience with exception handling, unit testing, and the basics of software engineering.
Course Objectives
By the end of this course, students will:
- Gain proficiency in Java syntax and semantics.
- Understand and apply the object-oriented paradigm.
- Learn the fundamentals of unit testing to ensure code quality.
Learning Outcomes
By completing this course, students will be able to:
- Write efficient and well-structured Java programs using OOP principles.
- Apply encapsulation, inheritance, and polymorphism in real-world scenarios.
- Use foundational data structures and collections to solve programming problems.
- Understand and implement basic unit testing in Java to ensure software reliability.
Programme Details
- Introduction to Java: Syntax, semantics, variables, and the program development process.
- Programming Constructs: Loops, conditionals, and control flow.
- Classes and Objects: Defining and using classes in Java.
- Inheritance: Extending classes and reusing code.
- Abstract Classes and Interfaces: Advanced OOP concepts.
- Exception Handling: Writing robust and error-resistant code.
- Arrays: Single and multi-dimensional arrays.
- Java Collections Framework: Lists, sets, maps, and queues.
- Generic Types: Writing reusable and type-safe code.
- Unit Testing: Introduction to testing frameworks like JUnit.
This course is designed for beginners and assumes no prior programming experience, making it ideal for those looking to build a strong foundation in object-oriented programming with Java.
Development Tools
To get started with Java development, you will need the following tools:
- Java Development Kit (JDK):
- Oracle JDK — Official JDK from Oracle.
- OpenJDK — Free and open-source alternative, supported by the community.
- Integrated Development Environment (IDE):
- Eclipse IDE for Java Developers — A powerful IDE for Java development with extensive plugin support.
- IntelliJ IDEA Community Edition — A modern and user-friendly IDE for Java, free for personal use.
- Visual Studio Code — Lightweight editor with Java support via extensions (e.g., Java Extension Pack).
References
Official Documentation
- Java Code Conventions — Guidelines for writing clean and consistent Java code.
- Java Language Specification (JLS) — Comprehensive technical details about the Java language.
- Java Development Kit Documentation — Official JDK 21 documentation, including API references and guides.
- How to Write Doc Comments for Javadoc — Best practices for writing documentation comments in Java.
Tutorials
- Java Tutorials — Oracle’s beginner-friendly tutorials for learning Java.
- Introduction to Java Programming — Beginner’s guide to Java programming.
- Eclipse IDE Tutorial — Comprehensive guide to using Eclipse for Java development.
- Eclipse Shortcuts — Tips to improve productivity with Eclipse.
- Java Debugging with Eclipse — Learn how to debug Java applications using Eclipse.
- JUnit Tutorial: How to Write Unit Tests — Guide to writing unit tests in Java using JUnit.
Practice Tasks
Part One (1st semester)
1) Using the Eclipse IDE for Java programming
2) Loops and Conditionals in Java
3) Basic Java Syntax. Strings, Arrays, java.lang.Math
4) Methods and Method Overloading in Java
6) Basic Object-Oriented Programming in Java
Part Two (2nd semester)
7) Object-Oriented Programming: Inheritance
8) Object-Oriented Programming: Method Overriding, Polymorphism
9) Object-Oriented Programming: Advanced Capabilities
10) Java Collections: Lists, Maps, Sets
11) Generics in Java
12) Java Threads: Defining and starting a thread
Classroom Activities