Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme
Group
Reviews
About us
Start
Start learning
Start learning now
Articles
Authors
All groups
All Articles List
CodeGym
/
Java Blog
/
Java Objects
Java Objects
231 members
Leaderboard
Popular
New
Old
Milan Vucic
Java Objects
26 July 2022 9:56
Compare String and Equals comparisons in Java
Hi! Today we will talk about a very important and interesting topic, namely, comparing objects with objects. The == operator compares object references, not object properties. Two objects could even have 500 fields with identical values, but comparing them would still yield false. After all, references car1 and car2 ...
John Selawsky
Java Objects
19 July 2018 12:04
Object lifecycle
Hi! I think you wouldn't be very surprised if I told you that your computer has a limited amount of memory :) Even your hard drive (which is many, many times the size of RAM) can get chock full of your favorite games, TV shows, and other things. To prevent this from happening, you need to monitor the current state ...
Aditi Nawghare
Java Objects
10 January 2023 12:02
Wrapper Classes in Java
Hi! You are already well acquainted with primitive types, and have worked quite a bit with them. In programming (and Java in particular), primitives have many advantages: they use little memory (and thus make the program more efficient) and have a clearly delineated range of values ...
Pavlo Plynko
Java Objects
21 March 2019 15:33
Sequence of actions during object creation
Hi! Today's lesson will be quite... uh... multifaceted :) in the sense that we will cover a wide range of topics, but they will all relate to the object creation process. We will analyze it from beginning to end: how constructors are called, how and in what order fields (including static fields) are initialized, etc...
Milan Vucic
Java Objects
26 March 2020 15:53
Equals Method in Java: Best Practices
Hi! Today we'll talk about two important methods in Java: equals() and hashCode(). This isn't the first time we've met them: the CodeGym course begins with a short lesson about equals() — read it if you've forgotten it or haven't seen it before...
Vasyl Malik
Java Objects
20 October 2020 11:49
How to swap objects in Java?
Swapping objects is one of the most popular actions in programming. It’s particularly useful in sorting. What happens in swapping is two variables exchanging their values. In this article, we learn how to swap objects in Java in two different cases. One is swapping...
Oleksandr Miadelets
Java Objects
30 December 2024 7:00
Java hashCode()
First of all, before we define Java hashcode, we need to understand what is hashing and what is it for. Hashing is a process of applying a hash function to some data. A hash function is just a mathematical function. Don’t worry about this! “Mathematical” is not always means “complicated”...
Milan Vucic
Java Objects
6 February 2025 15:45
Java toString() Method
Pretty often while creating a program, it’s necessary to find out the contents of an object. For these purposes, the Java Object class, the most basic Java class in the class hierarchy, defines a special toString() method. It returns a character string that describes the object...
Milan Vucic
Java Objects
16 November 2023 14:18
HashCode Method in Java: Best Practices
Hi! Today we'll talk about two important methods in Java: equals() and hashCode(). This isn't the first time we've met them: the CodeGym course begins with a short lesson about equals() — read it if you've forgotten it or haven't seen it before...
Artem Divertitto
Java Objects
17 December 2024 10:58
Pairs in Java
In programming, there are situations where we need to work with pairs of values, where each value has a corresponding key associated with it...
Please enable JavaScript to continue using this application.