What are good resources for learning imperative programming in Java before OOP?
Asked by
!try the other lid
I'm taking an introductory university programming course that uses Java but deliberately postpones object-oriented programming. The goal is to learn general imperative and procedural concepts first, then study OOP later. I like that approach, but the lectures haven't been especially effective, and most Java resources introduce classes and objects almost immediately. Can anyone recommend a book, course, lecture series, or exercise collection that teaches programming fundamentals with Java while keeping OOP to a minimum at first? I'm mainly trying to understand control flow, algorithms, procedural abstraction, and problem-solvingโnot just memorize Java syntax.
Answers
The free Java course from the University of Helsinki is another option. Its first few parts concentrate on basic programming, methods, loops, arrays, and problem-solving, with object-oriented programming introduced later. Although the course is no longer actively maintained, the introductory material and exercises are still worthwhile. Think Java is also a good free online resource that postpones objects until later chapters.
Reply to this answer
David J. Eckโs free book Introduction to Programming Using Java, also known as Javanotes, is a strong fit. The early chapters focus on variables, control flow, arrays, static methods, algorithm development, and procedural abstraction. Objects are mentioned, but the main OOP material begins later. The exercises are useful for practicing the fundamentals.
Reply to this answer
Thereโs some disagreement about whether Java is the ideal language for teaching procedural programming. C or Pascal would present that style more directly, while Java adds class-related structure even for small programs. Still, if your course requires Java, learning the fundamentals with static methods is perfectly workable as long as you later connect those ideas to Javaโs object-oriented features.
Reply to this answer
For simple exercises, you can put your static methods in one class and treat that class like a program module. JShell can also make experimentation easier because you can try expressions, conditionals, and loops without much surrounding boilerplate. Just keep in mind that this is a temporary learning setup; Javaโs standard libraries and larger programs are designed around objects, so youโll eventually want to learn the object-oriented model rather than avoid it permanently.
Reply to this answer
Add your answer
Answers are reviewed before publication.
_not.a.referee: For extra practice, CodingBat works well because most problems are short static-method exercises and donโt require building an object hierarchy.