Arama Sonuçları: "#JavaTips"

20 sonuç
Akshay M
Akshay M@akshayxml·
In Java, the `equals()` method compares object references by default. To compare object values, override it with a custom implementation that returns true only when both objects have identical properties. This ensures correct equality checks in your code. #JavaTips
English
0
0
0
7
Akshay M
Akshay M@akshayxml·
Java's `String` class uses an intern pool to store string literals, which means that if you create multiple strings with the same content, they will reference the same object in memory. This can have significant performance implications when working with large datasets. #JavaTips
English
0
0
0
5
JavaStackPro
JavaStackPro@JavaStackPro·
Java tip: Use Optional to avoid null checks, but don’t overuse it in fields. Favor immutability, leverage records for DTOs, and keep methods small and focused. #JavaTips
English
0
0
0
3
JavaStackPro
JavaStackPro@JavaStackPro·
Java tip: Prefer composition over inheritance, use Streams wisely (not everywhere), cache expensive calls, and always profile before optimizing. Clean code > clever code. #JavaTips
English
0
0
0
3
Ayush
Ayush@viperdizzert·
Stop writing loops for every collection. Use Java Streams. 🧵 ​Your future self (and your code reviewers) will thank you. ​#JavaTips #java
Ayush tweet mediaAyush tweet media
English
0
0
6
70
Kolusu Trinadh Kumar
Kolusu Trinadh Kumar@KolusuTrinadh·
From Java 11 , Arrays.sort() uses TimSort internally. You don't need to write the TimSort algorithm yourself. This is a significant convenience. #JavaTips
English
1
0
2
21
Akshay M
Akshay M@akshayxml·
Java's `Integer` cache: Between -128 and 127, Java caches Integer objects to improve performance. This means if you use a value within this range, it will return the same object instance each time. #JavaTips #PerformanceOptimization
English
0
0
0
23
codeBuilder
codeBuilder@nishek_sharma·
Just realized you can do this in Java: Map<String, List<String>> map = new HashMap<>(); map.put("fruits", new ArrayList<>()); map.get("fruits").add("apple"); map.get("fruits").add("banana"); map.values() = all your lists in one go 🥳 Mind blown 🤯 #JavaTips #CodingLife #DevHack
English
0
0
0
14
Ankit🧾
Ankit🧾@Ankit_ahhirana·
Java devs in India—struggling with clunky code? I (@Ankit_ahhirana) cut my build time in half with these 5 hacks. Who's ready to level up? 🔥 #JavaTips
English
1
0
0
50
Crack Ease
Crack Ease@CrackEase1519·
Sharp • Dev-centric • Scroll-stopping Java lets you create your own errors — not just handle them. 🌋 Custom Exceptions help you define, throw, and control errors your way. Clean code. Clear logic. Better debugging. 🔗 crackease.com #Java #CustomExceptions #JavaTips
Crack Ease tweet media
English
0
0
0
1
Programando en Java
Programando en Java@ProgEnJava·
¿Sigues usando if-else como si fuera 2005? 😎 🧠 Conoce el patrón Strategy en Java: encapsula algoritmos, cambia comportamientos en runtime y dile adiós al código spaghetti 🍝 #JavaTips #CleanCode #DesignPatterns 👇
Español
1
4
8
506
Akshay M
Akshay M@akshayxml·
"Java's default string concatenation using + operator creates a new object each time, whereas using StringBuilder/StringBuffer can reduce memory allocation & improve performance." #JavaTips #PerformanceOptimization
English
0
0
0
6
Programando en Java
Programando en Java@ProgEnJava·
📦 Una clase, UNA sola razón para cambiar. ¿Difícil? Sí. ¿Necesario? También. El principio de responsabilidad única no es opcional, es supervivencia en Java. 🔥 Menos es más. #CleanCode #JavaTips #SRP 👉 ¿Tu código lo respeta?
Español
0
1
15
416
Akshay M
Akshay M@akshayxml·
In Java, when using `equals()` method on objects, it compares references by default. To compare object values, override `equals()` and implement `hashCode()` correctly to ensure correct behavior. #JavaTips #ObjectOrientedProgramming
English
0
0
0
5
Java Code Geeks
Java Code Geeks@javacodegeeks·
🔁 Tail-call optimization in Java? Learn the techniques that make recursion safer and cleaner. #JavaTips
English
0
0
4
900
Java Code Geeks
Java Code Geeks@javacodegeeks·
🔍 Compare traditional threads vs virtual threads and understand when each shines. #JavaTips
English
0
0
5
1.1K