I have spent some time this weekend explaining Java - well to be more precise a Java problem - to my precious one and her class mate. There was one problem the whole five hours I am trying to solve the 2.0 way.
Learning Java without some basic knowledge is a pain. I decided to write a series of posts to explain basic OOP (object-oriented programming) concepts and show some examples in Java.
We are all from Germany and their teacher is for an unknown reason using german words in class so I will add a translation to all important words
Why the .... Java?!
Most examples will be written in Java and sometimes I will compare Java to Python or something else to show the differences and the similarities. I am no Java fan even if I use it from time to time but they are forced to work with it. If you are trying to gain some ground in OOP Java is not the worst choice - well this is the only thing I can imagine where Java is not the worst one so "yay Java, you made it!".
From Zero to something slightly above
This will not be you first and only source you ever need to become a Java master. If you are already using it you are likely only reading my series to flame me for some vague terms or the fact that I disagree with some design principles.
If you are not sure about all this OOP stuff, if you want to learn the basics and if you are looking for a "reference card" to look up some words this will be perfect for you. All, well let us call them lessons because we could learn something, lessons will be as short and precise as possible.
A good example are functions and methods. Even if they are basically the same they are two different things if you look at them. Since new words can be confusing and there is already a lot to remember it could be possible that we just call a function method even if it is not part of a class. Just to give you an example what I mean when I am talking about vague terms.
I am currently building an invoice system and I think it is a good example to explain some OOP concepts. You know, creating a list of invoices, sorting them and stuff like that.
In the next few posts we will learn some vocabulary. This is essential if you want to read and understand code, books, tutorials and maybe, some day write a piece of code.
When we know what we are talking about we will look at the basic structure and start building our own little invoice system. By the way, it will not be ready for production use so stop dialing the number of the marketing agency.
What did we learn?
- Object-oriented programming will from now on be remembered as OOP (yeah, I am lazy)
- methods and functions are not the same but you will to a certain point think they are
Even if you do not need a crash course in OOP and Java, I hope you will at least have some fun with this series.
- methods & functions = Unterprogramme