Is it possible to loop through all Java files in a given directory and create a Java Object from each of those files? Assume all files are Classes.
Example: Assume I have a directory named "playing_cards", and each file in this directory correlates with one of the 52 playing cards and they all inherit the same Class: PlayingCard.
List<PlayingCard> deck;
for(File file: playing_cards){
deck.add(new PlayingCard(file.path()));
}