Posty z #JavaTips

#JavaTips

Publiczne posty w X, które używają #JavaTips.

Powiązane hashtagi

  1. Ayush@viperdizzert
    Stop writing loops for every collection. Use Java Streams. 🧵 ​Your future self (and your code reviewers) will thank you. ​#JavaTips #java
    Pobierz
    00778
  2. Vrushali@Vrushali0988
    Java Streams confused? Stream - pipeline for processing data: → filter() → keep what you need → map() → transform values → reduce() → combine into one result Many values → process → result #Java #JavaStreams #JavaTips
    10370
  3. Virendra Codes@VirendraCodes
    @VirendraCodes
    2️⃣ How does it work? Objects in Java become eligible for GC when they have no active references. The GC sweeps them away, freeing up memory! 🔥 💡 Ways to make an object eligible for GC: ✅ Assign null → obj = null; ✅ Reassign reference → obj1 = obj2; #JavaTips
    10210
  4. Mario Casari✓@mario_casari
    💡 Java tip: Use Duration and Instant for precise time calculations. ✅Instant represents a point in time in UTC, with nanosecond precision. Can be obtained by #Java #JavaTips 🧵
    226429
  5. Java Code Geeks@javacodegeeks
    💡 Wondering when to use a record instead of a class? We’ve got the real-world answers! #JavaTips
    1131.2K
  6. Mario Casari✓@mario_casari
    💡 Java tip: Starting from Java 11, if you need to repeat n times a specific string, you can use the String method repeat(n). ✅ Example: String result = "$".repeat(10); System.out.println(result); // $$$$$$$$$$ #Java #JavaTips
    14622.8K
  7. Mario Casari✓@mario_casari
    💡Java tip: Since Java 15 you can write multiline strings more easily with 'Text Blocks'. ✅ Writing JSON content with a text block: String json = """ { "name": "John", "age": 30 } """; ✅ No escape characters ✅ No '+' signs ✅ Easy indentation #JavaTips
    29903.6K
  8. 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
    10225
  9. Mario Casari✓@mario_casari
    💡 Java tip: Starting from Java 8, you can remove nulls easily with list.removeIf(Objects::isNull). List<String> names = new ArrayList<>(Arrays.asList("A", null, "B", null, "C")); #Java #JavaTips 🧵
    1010340
  10. Java Code Geeks@javacodegeeks
    💡 Did you know understanding the Java Memory Model can save your app from OutOfMemoryError? Get the details here! [link] #JavaTips #DevOps
    16321.8K
  11. Java Code Geeks@javacodegeeks
    🛠️ Debugging memory leaks is hard… unless you know exactly what to look for. #JavaTips
    0051.3K
  12. Mario Casari✓@mario_casari
    💡Java Tip : Prefer constructor injection over field injection. ❌ Field injection: @Component public class UserController { @Autowired private Logger logger; public void createUser(String username) { ... } } 🔴 Harder to test in insolation. #JavaTips
    107245
  13. Java Code Geeks@javacodegeeks
    🔍 Compare traditional threads vs virtual threads and understand when each shines. #JavaTips
    0051.1K
  14. Pokaż więcej postów