Java

  • Java Varargs: What is it and how it work?
    Published on
    Varargs were introduced in Java 5 and designed to solve the problem of handling an arbitrary number of parameters in a method. But what exactly is this problem? What are varargs and how can we use them effectively?
  • Simplify Resource Management With Try-With-Resources
    Published on
    Before Java 7, developers relied heavily on the traditional try-catch-finally approach to manage resources, which was often verbose and error-prone. With the introduction of try-with-resources, Java simplified this process significantly.
  • [Java] - How to write a custom Java annotation?
    Published on
    When working with the Java programming language, you're likely familiar with using annotations to mark methods or classes. But can we create our own custom annotations and use them in our code? The answer is yes! In this post, I’ll show you how to create a custom annotation for validating phone numbers.