I have this code of Memory Managment Unit. I made an abstract algorithm Ialgo with 2 Implements. I want to with the MMU class handle different situations. To do this i made a method that get a capacity to make the RAM and get also and Ialgo (1 of the 2 algorithm) but how i can do new for the "algo" member and get the class of the algo i've introduce on the method from the main. Here is the code:
public class MemoryManagmentUnit {
private Ialgo<Integer> algo;
private RAM ram;
public MemoryManagmentUnit(int ramCapacity, Ialgo<Integer> algo){
this.ram = new RAM(ramCapacity);
this.algo = new ....?
}