r/learnjava • • Nov 01 '20

What are some must-know Java skills for beginners?

Basically title. I’m looking for any suggestions of certain things any Java Developer should know, however basic or advanced as they may be. I’ve been going through Codecademy’s Java course as well as doing basic challenges online, but I’m looking for more applicable and useful things to know how to do. Thanks in advance!

Edit: Sorry to be the guy saying thanks in a post edit, but thanks! I’m compiling a list of all the specific topics and concepts you guys are listing, I really appreciate everyone’s guidance.

58 Upvotes

31 comments sorted by

38

u/[deleted] Nov 01 '20

Most definitely understand everything about Objects and the different class types.

11

u/[deleted] Nov 01 '20

I understand what classes are but not class types – good to know! Thank you

17

u/HecknChonker Nov 01 '20

Programming is really just moving data around, and modifying it in ways that help you accomplish something.

Objects are just a way of grouping a few pieces of data together (variables/members) along with ways to interact with that data (functions). You only have to define an object once and then you can create multiple instances of it, where each instances can have different values for each of it's members.

So someone might ask, "What type does this variable have?" and they are just asking what Class it is.

There are also primitive types like int, short, long, boolean, etc. They have corresponding wrapper Classes Integer, Short, Long, Boolean, etc. Only the wrapper classes would be considered Objects.

2

u/[deleted] Nov 01 '20

Okay, so at the risk of oversimplifying it is a class type == data type? Within the work I do we have similar concepts and I’ve been trying to draw parallels wherever I see them. Data types just include primitive data types, while class types do not necessarily (unless a class is defined with a single “parameter”?)

Thanks for the explanation, as well!

2

u/HecknChonker Nov 01 '20

Yeah, I think you got it.

A class can totally have one or even zero members and still be a class.

The java wrapper classes for primitives are a little special in that java can convert between the two automatically using auto-boxing and auto-unboxing. Basically, if you have a method that takes an Integer and you pass in a primitive int java will convert it automatically, and the opposite is also true.

I often create utility classes that only have methods and no data to group related functions together, especially when I might want to reuse those in multiple places. Those methods are usually static, which lets you call them without having to create an instance of it first. The Math class is an example of this.

So you can say:

 Math.min(1,2);

Without saying

 Math math = new Math();

The trade-off is that static methods cannot access non-static data in the class, and static data cannot have a different value per instance. Every instance will share the same value for the static member.

Feel free to ask if you need any clarification, and don't feel bad if some of this feels like a lot to wrap your head around.

23

u/Prime_1427 Nov 01 '20

Data types, control statements, classes and interfaces, OOPs concepts , loops etc.

10

u/[deleted] Nov 01 '20

I still have no understanding of how interfaces are designed using Java, so that’s definitely something I’ve yet to learn. I’m an Appian Developer which is a very very niche platform for business process management that’s used a lot in PubSec. I’ll understand most things pretty well minus anything unique to OOP, so like “control statements” is just a foreign concept to me. Thanks 🙏🏼

7

u/[deleted] Nov 01 '20

Upon further reading, I now understand that you didn’t mean user interfaces! TIL

7

u/Prime_1427 Nov 01 '20

Yes. (User interface != Interface) in Java. 😅

6

u/WanabeVarbie Nov 01 '20

There is a book called absolute java. I highly recommend it as an undergrad in compsci myself. It was an excellent ressource that complemented my classes very well along with online videos. It isnt a big book either.

11

u/manoj-jena Nov 01 '20

Exception Handling, Collection, Database Operations using Java

3

u/[deleted] Nov 01 '20

Database operations – would that be the use of JPA? Or I’m assuming there’s a lot more to it than that? I have some experience using JPA and writing XSD files to match schemas to tables, although only within the context of my own work. No idea how it would be different working directly in Java. Thanks for the reply too btw

4

u/manoj-jena Nov 01 '20

JPA is more than enough. Good luck

5

u/khiari_hamdi Nov 01 '20

There s a nice interactive book from O’Reilly that explains all the basics in a good a way, i ll search it and send you the Link. They have also the same thing for python. For me it was very helpful at the beginning to have everything at one place. I find books better than tutorial websites to learn programming because you can really get lost in all the stuff that s online

5

u/khiari_hamdi Nov 01 '20

This is the link to the books :

https://books.trinket.io

And there s this website from a university in Singapore that has very good ressources and exercises for java and other CS topics, this is the same stuff that we had at our university. it s worth a check :

https://www3.ntu.edu.sg/home/ehchua/programming/index.html

2

u/[deleted] Nov 01 '20

Thanks for taking the time to find and link it! I’ll check it out

4

u/HerbackWOMemes Nov 01 '20

Scope and pass-by-value :)

4

u/[deleted] Nov 01 '20 edited Nov 01 '20
  • Participate in Java forums as much as you can.

  • Read Official Java documentation. (Must)

  • I.D.E. - learn modern Integrated Development environments(Intellij, Netbeans, Eclipse..) available for Java.

  • Debugging- How to remove errors from a projects. One of most important skills which beginners are unaware about.

  • Collections

  • Strings

  • Design Patterns(Observer, DAO, Builder design)- Modern Projects or Large scale industrial projects require design patterns.

  • Learn another Object oriented language - Kotlin, Swift, or any other modern object oriented language.

  • Create a complete project in Java(Must)- You will learn tons more by making a project than any tutorial or course can teach you.

  • Frankly, You cannot survive by core Java only. At some point, You will have to learn more than core Java(Basics of Java).

3

u/AnotherRichard827379 Nov 01 '20

ADTs and recursion

3

u/stao123 Nov 01 '20

Collections, streams, functional programming with lambdas

2

u/pizdec-unicorn Nov 01 '20

I think static methods / static final constants are sometimes overlooked, but it's still good to know. I'd also recommend trying to learn the key additions/changes to each SE release as you progress so you don't run into weird backwards-compatability problems.

2

u/xRageNugget Nov 01 '20

That you cannot should not compare Strings with "==".

3

u/AutoModerator Nov 01 '20

You seem to try to compare String values with == or !=.

This approach does not work in Java, since String is an object data type and these can only be compared using .equals().

See Help on how to compare String values in our wiki.


Your post is still visible. There is no action you need to take.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/xRageNugget Nov 01 '20

Good bot but no

0

u/[deleted] Nov 01 '20

[deleted]

3

u/Wandererofhell Nov 01 '20

i am so lost trying to use debug in java, i feel so overwhelmed by it i get ptsd whenever I think of debugging. I can understand python debug but I have no clue what to do after i put breakpoints and press that debug button

1

u/Baljit147 Nov 01 '20

There's usually a tutorial for the debugger on youtube for whatever IDE you are using. That's how I learned to use it.

2

u/WanabeVarbie Nov 01 '20

Man i need to get to doing that

2

u/[deleted] Nov 01 '20

[removed] — view removed comment

3

u/[deleted] Nov 01 '20

I’ve been doing Edabit for some time, I have no idea how common it is but it has problems of varying levels of difficulty. The stuff I’ve been doing is as simple as creating functions that perform specific tasks. Calculating object perimeters or converting units of measurement – stuff like that.