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):
- IntelliJ IDEA Community Edition — A modern and user-friendly IDE for Java, free for personal use. Tutorial: Create your first Java application.
- Visual Studio Code — Lightweight editor with Java support via extensions. Tutorial: Getting Started with Java in VS Code.
- Eclipse IDE for Java Developers — A powerful IDE for Java development with extensive plugin support. Tutorial: Using the Eclipse IDE for Java programming.
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 25 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
Final Task
Literature
For Beginners
-
The Java Programming Language. Ken Arnold, James Gosling, David Holmes. ISBN: 9780321349804. A classic book written by one of Java’s creators. A great starting point for those who are just beginning to learn Java.
-
Core Java, Volume I: Fundamentals. Cay Horstmann. ISBN: 9780135328378. One of the best resources for mastering Java. This first volume of two provides a detailed overview of fundamental topics, including OOP, reflection, interfaces, inner classes, exception handling, generics, collections, lambda expressions, concurrency, and more.
-
Head First Java: A Brain-Friendly Guide. Kathy Sierra, Bert Bates, Trisha Gee. ISBN: 9781491910771. A fun and interactive approach to learning Java. Perfect for beginners who want to quickly grasp the basics.
-
Java: A Beginner’s Guide. Herbert Schildt, Danny Coward. ISBN: 9781265054632. A simple and clear guide for beginners that covers all the essential Java concepts, including new features introduced in Java 21+.
For Experienced Developers
-
Core Java, Volume II: Advanced Features. Cay Horstmann. ISBN: 9780135371749. An in-depth analysis of enterprise programming, networking, databases, security, localization, and working with XML.
-
Thinking in Java. Bruce Eckel. ISBN: 9780131872486. A must-read for every developer. Helps understand Java’s philosophy, architecture, and approaches to problem-solving. Very deep and insightful for understanding what Java truly is.
-
Effective Java. Joshua Bloch. ISBN: 9780134685991. Each chapter consists of loosely connected small articles illustrating Java’s nuances. Written by a seasoned practitioner. Absolutely essential for experienced developers. Contains practical tips on writing efficient and secure code.
-
Java Concurrency in Practice. Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, Doug Lea. ISBN: 9780321349606. The best resource for learning multithreading in Java.
-
Modern Java in Action: Lambdas, Streams, Functional and Reactive Programming. Raoul-Gabriel Urma, Mario Fusco, Alan Mycroft. ISBN: 9781617293566. Covers modern approaches to programming in Java, such as lambda expressions, streams, and reactive programming.
About Development in General
-
Design Patterns: Elements of Reusable Object-Oriented Software. Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. ISBN: 9780201633610, 9780201634983. A classic on design patterns. Must be read in the original language! Translators have done their best to ruin everything beyond recognition.
-
Applied Java Patterns. Stephen Stelting, Olav Maassen. ISBN: 9780130935380. Dedicated to design patterns—techniques for organizing programs that have proven effective in practice. Useful for designing program architectures.
-
Bug Patterns In Java. Eric Allen. ISBN: 9781590590614. About what not to do. Typical mistakes made by Java developers. Very useful for those who want to avoid common pitfalls.
-
Refactoring: Improving the Design of Existing Code. Martin Fowler. ISBN: 9780134757599. Teaches how to improve existing code, making it more readable and maintainable.
-
Clean Code: A Handbook of Agile Software Craftsmanship. Robert C. Martin. ISBN: 9780132350884. The best book for understanding the principles of writing clean and high-quality code.