NEW BLOG POST - learning Java
Object-Oriented Principles and Resources - How to get started and background information...
Object -oriented programming or OOP, is basically a programming technique that organizes design around objects in the place of functions. Java is one type of object-oriented programming language. There are 4 basics when speaking about object-oriented programming and I will do my best to explain them as I can: Encapsulation, Abstraction, Inheritance, and Polymorphism.
Encapsulating is simply saying to protect an object from other programs or objects, by "encapsulating" the object inside of code. You will often see this being described as an empty pill case encapsulating the medicine inside (if you're under 30 you will likely still not understand this, lol). This basically keeps other objects from touching the object that is encapsulated, unless it is explicitly programmed to do so.
Next is Abstraction. and this can be thought of as an "extension" of our previous listing. This basically means that in high level coding, that the objects that are encapsulated are only exposing public facing operations relevant to other objects, and hide-away their internal structures for safe keeping.
Inheritance is basically what it sounds like. Inheritance acts as a copy function of sorts, allowing for common logic to be brought down to similar processes (parent --> child) , while allowing for unique functions to stay. This is crucial for programs that's are similar, you can create a child function off of a parent function, while creating more exact criteria for each.
Last, we have polymorphism. Polymorphism basically allows you to use the child class exactly like the parent class, all while keeping its unique methods as they appear.
Now, it is time to get down and start writing in Java.... but how?
There are plenty of free Java-type programs, and you will need a writing program to tag along as well, however, I recommend the easier solution. I find it much more beneficial to use a web-based Java compiler like - Online Java Compiler - online editor (onlinegdb.com) or Online Java Compiler - Online Java Editor - Java Code Online (jdoodle.com). These 2 compilers are wonderful, user friendly, albeit less powerful and capable than the full versions you can download. I find them to be easier to learn on as they tend to break down any mistakes you may be making, however there is one downside to these sorts of programs, you cant really save your progress with these type of programs. If you are writing longer more comprehensive code, or something you need to come back to, I would not recommend... although I doubt you'd be reading my intro to Java blog if you had vast experience!!
Comments
Post a Comment