★ Sr Backend Developer | 9+ years Experience
★ Sharing my experience via tweets & threads
★ Explains complex conceptsdev-lovepreet.hashnode.dev PunjabJoined May 2022
The Tricky Part: == vs .equals()
This is where == gets tricky! == checks if two references point to the exact same object. For numbers in the pool, they often do. Outside the pool, even if values are identical, they're separate objects. Always use .equals() for value comparison
Try this 🤔
Integer a = 100; Integer b = 100;
System.out.println( a == b) // true
Integer x = 200; Integer y = 200; // false
you know why?! #Java#Programming 👇
Key Takeaways:
Java's String Pool reuses literals.
new String() always creates new objects.
intern() forces pooling.
== vs .equals() is crucial for comparison
Classic Gotcha: `==` vs `.equals()`
Comparing user input (often dynamically created Strings) with constant literals using == will likely fail! ❌ Always use .equals() for content comparison. Remember: == for reference, .equals() for value.
Q: How do you share variable in thread life cycle?
A: Java ThreadLocal class allows the storage of data that is specific to each thread separately.
It is often used to implement thread-specific context or to avoid synchronisation for thread-local data
36K Followers 342 FollowingRetired from chasing twitter algo | Building @techxploreio @juggujarat | More active on LinkedIn | Turns out building offline is more fun than collecting likes.
90K Followers 398 FollowingEngineering Lead. Ex Microsoft. 10+ years of building smart software that scales. I will help you build a great career in tech 🚀. DMs open 🙂
0 Followers 12 FollowingA digital branding and identity platform focused on helping creators, founders, and organisations articulate value, scale presence, and compete globally.
30 Followers 198 FollowingI’ll be sharing practical coding tips, clean code insights, and battle-tested habits I use daily.
If you're into writing better code — follow along. 🚀
26 Followers 338 FollowingVersecard – Digital Business Card
Make your first IMPRESSION count
Share your details with just a TAP 📱
Sleek as you like 👌
Order Now 👇🏽
https://t.co/LfNBAJrY1X
36K Followers 342 FollowingRetired from chasing twitter algo | Building @techxploreio @juggujarat | More active on LinkedIn | Turns out building offline is more fun than collecting likes.
90K Followers 398 FollowingEngineering Lead. Ex Microsoft. 10+ years of building smart software that scales. I will help you build a great career in tech 🚀. DMs open 🙂
1.2M Followers 159 FollowingWe're a community of millions of people who are building new skills and getting new jobs together. A 501(c)(3) public charity. Tweets by @abbeyrenn.
16K Followers 494 FollowingFather of one, Principal Developer, Builds and writes web stuff.
building https://t.co/i8oXQzPQwb 👨⚖️🤖
https://t.co/f25X5v66O6
https://t.co/cMy3tNG8nn
https://t.co/Deh5hwAsdd
944K Followers 187 FollowingFounder & CEO @Zerodha @Rainmatterin Learning at @RainmatterOrg Musings on business & life: https://t.co/gQi9cu6E5h. Views are personal, Nothing is advice.
1.0M Followers 2 FollowingGet the latest from Hacker News! Top 5 stories on the hour, every hour. By @riklomas from @superhi_ – unofficial and not affiliated with Y Combinator
1.3M Followers 0 FollowingAuthor of the #1 NYT bestseller Atomic Habits (https://t.co/aWrO9DWkH5). I write about building good habits. Over 3 million people read my 3-2-1 newsletter.
239K Followers 754 FollowingOn a mission to become a better writer, thinker, and entrepreneur • Ex-dentist, now building an internet business (at ~$500k/year).
5.0M Followers 4 FollowingOpenAI’s mission is to ensure that artificial general intelligence benefits all of humanity. We’re hiring: https://t.co/dJGr6LgzPA
126K Followers 111 FollowingI teach @CS50.
Gordon McKay Professor of the Practice of Computer Science, Harvard University, [email protected]. Verify at https://t.co/NGJZ2KGgTc.
2K Followers 631 FollowingCareer opportunities for Developer Relations and Marketing professionals 🥑
Sign up for our job alerts to get the latest job opportunities to your inbox ⤵️
1K Followers 183 FollowingWe create technical marketing content designed to reach software developers. Join the newsletter for tips on dev marketing 👉 https://t.co/GQwijihS8u