Home > Java > javaTutorial > body text

Distinction With(out) a difference

PHPz
Release: 2024-07-15 21:41:51
Original
481 people have browsed it

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.

The above is the detailed content of Distinction With(out) a difference. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template