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
308 members
Leaderboard
Popular
New
Old
Milan Vucic
Java Objects
April 2, 2025 at 9:56 AM
Java Compare Strings
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
July 19, 2018 at 12:04 PM
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
January 10, 2023 at 12:02 PM
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
March 21, 2019 at 3:33 PM
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
March 26, 2020 at 3:53 PM
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
October 20, 2020 at 11:49 AM
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
December 30, 2024 at 7:00 AM
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
February 6, 2025 at 3:45 PM
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
November 16, 2023 at 2:18 PM
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
December 17, 2024 at 10:58 AM
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.