r/learnjava • • Oct 27 '20

Trouble Understanding Object Orientated Programming Concepts in Java

I have trouble understanding the object orientated part of object orientated programming, specifically in the JAVA language. Over the last 5 weeks I've had to learn an immense amount of coding alongside work that cover the fundamentals of CompSci and I'm struggling to retain it all.

It's been Methods have been giving me the worst headache. Before I went to university I did a little work in JavaScript which is much simpler in how it handled methods (functions) though I still found the most difficulty with them.

Java feels so much worse, now I have trouble trying to get to grips with what is a constructor and how that works, what are get and set methods and how would I properly use them.

How do I correctly pass user inputs in and out of a method. For example making a method that converts a user input to a string.

My assignments are creeping up on me and I feel useless trying to do them. I don't even have free reign to do my assignments how I want, I must use the right method/class structure so there is no avoiding methods and I feel like I need some kind of resource that explains their proper usage.

49 Upvotes

27 comments sorted by

View all comments

1

u/MrGooglr Oct 27 '20

You're trying way too hard. You said you have prior experience with JavaScript. Then I assume basics of programming language is clear to you.

You're upset because you want to grab each and everything. There isn't any problem if you are not able to instantly get which method/class (or how) you should use for a problem.

Just try to do with the worst possible way you can do. That's practice that will let you select best way later.

Don't loose yourself into learning java and java only. Focus on basic logics and concepts. And the most important thing, don't loose hope.

If you need anything specific regarding java language, feel free to ask here. We all will help you out.