I'm a little lost here! Can someone give me a hint?
Implement the getAllAnimals method.
The method's pathToAnimals parameter is the absolute path to the directory where the compiled classes are saved.
The path doesn't necessarily have a "/" at the end.
Not all classes inherit the Animal interface.
Not all classes have a public no-argument constructor.
Only for classes that both inherit Animal and have a public no-argument constructor, create one object each.
Add the created objects to the resulting set and return it.
The main method is not tested.
Requirements:
- The size of the set returned by the getAllAnimals method must be equal to the number of classes that both support the Animal interface and have a public no-argument constructor (from among the classes found in the directory passed as an argument).
- The set returned by the getAllAnimals method must include all of the classes that both support the Animal interface and have a public no-argument constructor (from among the classes found in the directory passed as an argument).
- The set returned by the getAllAnimals method must NOT contain any classes that don't both support the Animal interface and have a public no-argument constructor (from among the classes found in the directory passed as an argument).
- The getAllAnimals method must be static.
package com.codegym.task.task35.task3507;
public interface Animal {
}