r/learnjava • • Jul 17 '20

Can Anyone Do Java?

I'm a college student who previously did Javascript and is now doing Java.

I'm finding Java horrifically hard. I thought that since I had a background in javacscript, I would have a easier time picking it up but I'm not.

Why? Why am I having a breakdown over it? Is it because javascript is more artsy and java is more mathy? I am an artsy person (not a math person) so that's why I'm asking.

What advice do you have for someone who is learning it? IT FEELS LIKE A COMPLETELY DIFFERENT SUBJECT FROM JAVASCRIPT! I'm starting to wonder if I'm just not built for it.

So my question is, is it meant for everyone? Can everyone do it?

62 Upvotes

65 comments sorted by

View all comments

8

u/staycoolioyo Jul 17 '20

Java is a lot more wordy with it's syntax which is part of the reason it can seem harder. I would focus on writing some simpler programs to learn the syntax. Even though Java and JavaScript are very different languages, they both have things like variables, if statements, loops, etc. it's just that Java makes you type out a lot more to do the same things. Once you get used to the syntax, things will get a lot easier. Don't give up!

2

u/TacticalWalther Jul 18 '20

its not just the syntax for me, its the fact that you can't merge doubles and ints in equations, you can't push things into arrays, etc. So many restrictions which weren't there in Javascript.

2

u/staycoolioyo Jul 18 '20

Oh yeah that can definitely be annoying for sure, but there are ways around it. You can type cast variables to mix doubles with ints, and if you want to change the size of a list I’d use an arraylist instead of an array. Arrays have a fixed size where arraylists don’t.

1

u/TacticalWalther Jul 20 '20

I didn't know about arraylists! Will use that now.