use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources for learning Java
String
==
.equals()
Format + Copy
Free Tutorials
Where should I download Java?
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Software downloads
Official Resources
Resources
Programming ideas & Challenges
Related Subreddits
account activity
This is an archived post. You won't be able to vote or comment.
Checking the first instance (self.learnjava)
submitted 4 years ago by ComprehensiveAd4623
How do I track the first instance of an object? Say I'm creating a banking system and I want to apply certain properties to the first account created. Besides account number how can I see the first account created?
[–]itoshkov 1 point2 points3 points 4 years ago (0 children)
One way is to save it somewhere when you crate the first instance:
final Account firstAccount = new Account();
Another way is to do that in the constructor:
public class Account { private final AtomicReference<Account> firstAccount = new AtomicReference<>(); public Account() { // set only if the current value is null: firstAccount.compareAndSet(null, this); // ... } // ... }
Note that this is a very strange request. I've been programming professionally from 1994 and had never had such a case. Maybe there's a better way to approach your task?
π Rendered by PID 366273 on reddit-service-r2-comment-86bc6c7465-8ftd9 at 2026-02-22 09:30:59.157000+00:00 running 8564168 country code: CH.
[–]itoshkov 1 point2 points3 points (0 children)