In Java, you can use method overloading to achieve the effect of optional parameters. Method overloading is the practice of having multiple methods with the same name but different parameter lists.