What are good resources for learning imperative programming in Java before OOP?
Asked by
MellowPine47
I'm taking an introductory university programming course that uses Java but intentionally postpones object-oriented programming. The goal is to learn general programming and imperative fundamentals first, then study classes and objects later. I like that approach, but the lectures haven't been especially effective, and most Java books introduce OOP almost immediately. Are there any books, courses, lectures, or exercise collections that teach concepts such as variables, control flow, arrays, functions, algorithm development, and procedural abstraction using Java, while keeping OOP to a minimum at the beginning? I'm mainly trying to understand the underlying programming ideas rather than memorize Java syntax.
Answers
Java can support an imperative-first teaching style, but it is still built around objects and its standard libraries are largely object-oriented. Using only static methods is workable for learning general concepts, though it can become awkward and may encourage habits youโll later need to change. If the goal is purely procedural programming, C or Pascal would be more natural choices; otherwise, itโs probably best to follow the course sequence and treat the early Java code as a temporary bridge to OOP.
Reply to this answer
You can keep the early exercises procedural by putting static methods in one class and treating that class like a module. JShell is also handy for experimenting with loops, conditions, and expressions without much boilerplate. Think Java is a free online book that delays objects until later chapters, and CodingBat provides lots of short static-method exercises. The introductory material by Sedgewick and Wayne also emphasizes control flow and arrays early on. Try writing small programs tooโreading alone can make it easy to over-study and under-practice.
Reply to this answer
David J. Eckโs free book Introduction to Programming Using Java, often called Javanotes, seems like a strong fit. The early chapters focus on variables, control flow, arrays, static methods, algorithms, and procedural abstraction, with exercises included. Objects are mentioned, but the main discussion of object-oriented programming begins later. The early sections of Helsinkiโs Java MOOC are another useful option; the first few parts cover fundamentals before moving into OOP.
Reply to this answer
Add your answer
Answers are reviewed before publication.
SilverBirch3: Whether Java is the ideal teaching language is something to discuss with the instructor, but that doesnโt make the request unreasonable. The suggested Java resources can still provide useful practice with fundamentals before classes and objects become the focus.