September 2019
Intermediate to advanced
816 pages
18h 47m
English
Let's assume that we have the following Melon class:
public class Melon { ... public void eat() {} public void weighsIn() {} public static void cultivate(Seed seeds) { System.out.println("The cultivate() method was invoked ..."); } public static void peel(Slice slice) { System.out.println("The peel() method was invoked ..."); } // getters, setters, toString() omitted for brevity}
This class has two static methods—cultivate() and peel(). Let's fetch these two methods in List<Method>.
The solution to this problem has two main steps:
In code, it looks like this:
List<Method> staticMethods ...