DEV Community

5arm
5arm

Posted on

How to learn object oriented programming

I am studying at Faculty of Electrical Engineering and Computing, and I have a subject OOP (object oriented programming) in Java.

That is the only subject that i did not manage to pass continuously. We have presentations and lectures, but they are (in my opinion) not so good.

My question is: How did you learn object oriented programming, what book/online course/YouTube channel did you use to learn the paradigm?

Thank you!

Top comments (6)

Collapse
 
bradtaniguchi profile image
Brad

There's plenty of excellent resources linked, and provided above, so I want to give my experience when learning OOP, I was pretty confused until I realized that there are really 2 main parts:

  1. The syntax

  2. The concept

Lets get this down first, Java syntax is verbose, knowing what the syntax means is a good first step into understanding the concept. Java is very Object Oriented (its an OOP language), so it learning its syntax is a great way get your "foot in the door" with actually understanding the concept.

Knowing what all the syntax for the hello world program in Java will help you understand parts of OOP:

public class HelloWorld {

    public static void main(String[] args) {
        // Prints "Hello, World" to the terminal window.
        System.out.println("Hello, World");
    }

}

OOP as a concept is actually pretty interesting and much easier to grasp in the idea that classes are blueprints to make instances of objects. If you think of something, that something could be described as a class, which can create instances.

You can extend and inherit classes to expand what they do. There is a lot of syntax and concepts that go along with OOP but the general idea is pretty simple. Goodluck 😄

Collapse
 
chirpycoder profile image
Prasanth Varikallu

It took me a long time to develop that kind of thinking. I was introduced to Java first and it absolutely made no sense for a really long time. Thinking everything as real world objects and visualizing them really helped me understand programming better. Solving problems is another good way to get into it. You can check Leetcode or Project Euler or any other site that has programming problems to get started. I came to form an opinion that programming is a skill and it takes time to acquire it and even more time to get better at it

Collapse
 
toshihidetagami profile image
Toshihide Tagami

I learned OOP by typing example code from books. If you just started learning Java, I recommend Head First Java.
After you grasp the basic, try Head First Design Patterns. That was an eye-opener for me!

Collapse
 
michaeloboyle profile image
Michael O'Boyle

This was helpful. poodr.com/

Collapse
 
mellen profile image
Matt Ellen-Tsivintzeli

My book of choice is Object Thinking by David West.

Collapse
 
mellen profile image
Matt Ellen-Tsivintzeli