0

i tried to create a instance of a class that implemented an interface, but the problem is that the constructor takes a parameter which is the interface itself.

Information: I dont want to implement the interface, class or funcinality by myself, because the library EJML has implemented it already, i just want to use the class and the functions.

    public class myMatrixFactory{
        public void do(){
            //Does not work because LinearSolver_B64_to_D64() needs a interface as parameter
            // parameter is LinearSolver<BlockMatrix64F> which is an interface
            LinearSolver_B64_to_D64 ls = new LinearSolver_B64_to_D64(????);
        }
    }
M.Mac
  • 699
  • 3
  • 14
  • 1
    Did you read the funky manual? http://ejml.org/wiki/index.php?title=Solving_Linear_Systems –  Dec 23 '16 at 12:02
  • Thank, as i am very new to programming, i am not familiar using the javadoc and manuals. – M.Mac Dec 23 '16 at 12:28

1 Answers1

2

You have to create an object of a class that implements the required interface and pass it to the constructor.

According to the link you provided you need an object of type LinearSolver<BlockMatrix64F> so you should take a look at this classes javadoc and choose one of the implementing classes.

JayTheKay
  • 1,463
  • 12
  • 22