DEV Community

Casey Echternacht
Casey Echternacht

Posted on

Distinction With(out) a difference

I'm relearning Java. It's one of the first programming languages I studied in school and it is hitting differently this time around.

For instance, I never mastered when to use public vs. private, the purpose of (String[] args) or the logic behind choosing a data type. I memorized patterns and tinkered with things like this whenever I got error messages, but I wasn't really understanding.

I just learned that "Integer a" and "int b" can both represent the same number, but they have different capabilities.

An Integer is an instance that has access to methods such as .equals and .compare. It can be converted to other data types if necessary.

An int does not have access to methods. We can compare ints through '=='.

As a younger learner, this seemed like a distinction without a difference and it was frustrating. I have much more to learn in this area, but I know see it as a meaningful gap that I look forward to filling.

Top comments (0)