This Java course is aimed at programming beginners. In my opinion, Java, like any, or at least almost any, programming language, is suitable for learning the basics of programming. But once you've overcome the initial hurdles, Java offers a rich environment for further development. And that's something not every programming language can say.
The days when we could prepare students for life with sandbox programs are over. I believe the future lies in complete systems with visual programming and a large repository of ready-made tools. And I believe Java has achieved this goal. Java is a language that champions reusability and visual programming. And Java comes with a large repository of ready-made program components that are easy to use thanks to its object-oriented approach. But the absolute highlight is the portability of the programs. Anyone who, like me, has switched operating systems twice knows what I mean.
Measurements show that Java is not significantly slower than optimized C for pure computational operations. This is a result of the good just-in-time compilers available for Java. The extensive and complex Swing library has also been programmed very efficiently and can now be used for real Java applications.
The alternative, Python, isn't really an alternative. It's at least as difficult to learn and much slower. The only thing that speaks in Python's favor is the libraries, which could just as easily be created in Java. However, it must be admitted that these libraries exist in Python but not in Java. This is the secret to Python's success. You have immediate access to optimization, statistics, modern numerical methods, and even neural networks. Python is also catching up in the area of cross-platform graphical user interfaces.
Another alternative is JavaScript. It was originally a scripting language, just like Python. However, because browsers are now almost exclusively programmed in JavaScript, this language has experienced a tremendous surge in popularity. It is now also used for standalone programs, as the example of Microsoft Flight Simulator demonstrates.
Of course, there are numerous other alternatives, both widespread and exotic. For beginners, this means that understanding the principles of programming is more important than the details of a programming language. Java is ideally suited for this.
It's true: you only learn programming by programming! Much of it is a craft and nothing more. Some parts are an art. But you really have to have faced a challenge yourself to truly appreciate the solution.
Some things will be difficult to solve at first. Many things won't be solvable at all. But only through this searching and trial and error can you discover how language works internally. And sometimes the famous "aha!" moment only comes much later.
So get programming! But be careful! It takes time. And not everything has to be perfect.
I've included plenty of practice exercises in each chapter, trying to make them neither too trivial nor too challenging. Looking back, much of it seems a bit too difficult. Don't be discouraged!
The entire course cannot be completed in one semester. I suggest a two-semester course with plenty of practice sessions. For someone new to programming, one shouldn't progress beyond the introduction of classes in a single semester. Of course, the temptation is strong to jump straight to one of Java's highlights, such as graphics programming or object-oriented design. But this temptation should be resisted in favor of the practical exercises.
I have not followed the prevailing trend of cutting the entire text into mosaic pieces and then trying to hold these pieces back together with hyperlinks. I believe that for this sometimes quite difficult subject, it is appropriate to insist on a traditional reading method. Therefore, there are pages here with an unusually large amount of text.
The examples in this course are somewhat math-heavy. This is appropriate for the target audience of my course. I ask those who are not mathematicians to skip over these examples. There are plenty of other examples available.
These files are a translation by Google from the German version. Although the translator is very good now, I cannot guarantee that the German sourde does not shine through and sometimes obscure the meaning. I want to go through the files later to check for inconsistencies and errors.
René Grothmann