Posts with #JavaDev

#JavaDev

Public posts on X that use #JavaDev.

Related hashtags

  1. Mario Casari✓@mario_casari
    💡 Java 14+ switch expressions are exhaustive: the compiler verifies that every possible value is handled. ✅ Miss an enum constant and compilation fails ✅ Fix it by covering all enum values or adding a default branch ✅ Safer refactors and fewer hidden bugs #Java #JavaDev
    Download
    15371.1K
  2. Martin Hock@mnhocktweets
    🚀 JUnit 5 Tip 🚀 Since JUnit 5, leverage package-private visibility for classes and methods to enhance encapsulation in your tests. This helps keep your testing logic close to the code it's testing while maintaining a clean and organized codebase. #JUnit #Testing #JavaDev
    Download
    17683.8K
  3. Mario Casari✓@mario_casari
    🚀 Java: With CompletableFuture.allOf(...) you can wait on multiple async tasks without manual join handling. #Java #JavaDev
    Download
    4141144K
  4. Mario Casari✓@mario_casari
    🚀 Spring Boot: To make your services return a paginated response, instead of a giant list, you can use Page<T> and Pageable. #SpringBoot #JavaDev 🧵A link to an example to follow:
    Download
    2121053.7K
  5. Mario Casari✓@mario_casari
    💡 Java tip: Use Files.readString() and Files.writeString() for straightforward file I/O. #Java #JavaDev
    Download
    28703.1K
  6. Mario Casari✓@mario_casari
    🚀 Spring Boot: A webhook is when another system sends a POST request to your app when something happens. In Spring Boot, you implement it simply by exposing an endpoint that receives that POST request. #SpringBoot #JavaDev
    Download
    09843K
  7. Mario Casari✓@mario_casari
    🚀 Spring Boot: If your code uses RestTemplate, you can implement tests by mocking external calls with MockRestServiceServer. ✅ MockRestServiceServer works by intercepting HTTP requests #SpringBoot #JavaDev
    Download
    111972.6K
  8. Mario Casari✓@mario_casari
    🚀 Spring Boot: You can implement optimistic locking using the @Version annotation. ✅ Ideal when: 🟢Reads are frequent 🟢Writes are relatively rare 🟢Conflicts are uncommon ❌ Not Ideal when: 🔴Conflicts are frequent 🔴Strict serialization is needed #SpringBoot #JavaDev
    Download
    010592.1K
  9. Mario Casari✓@mario_casari
    Java Tip💡: Starting from Java 14 you can use "record" to create short, immutable, data-carrying objects. ✅ They are shorter than ordinary POJOs ✅ They have built-in equals(), hashCode(), toString() ✅ They are immutable by default #Java #JavaDev
    Download
    9111124.5K
  10. Mario Casari✓@mario_casari
    💡 Java tip: Starting from Java 11, you can use String.strip() instead of trim(), since it handles Unicode whitespaces correctly. #Java #JavaDev
    Download
    010732.8K
  11. Mario Casari✓@mario_casari
    💡Java tip: You can use Collectors.joining(", ") to turn a stream into a comma-separated string (or another custom separator). #Java #JavaDev
    Download
    16661.8K
  12. Show more posts