I am using a java public interface in a matlab scripted (but object oriented) software.
We frequently have to call java methods and this work flawlessly. If I have the following java class:
package com.toto
public class Foo {
public static void printHello() {
System.out.println("Hello World");
}
}
Then in Matlab I just call:
com.toto.Foo.printHello
To get the print displayed in my console command.
Now what I would like to do is something similar to:
package com.toto
public class Foo {
public static <E> void printClass(Class<E> type) {
System.out.println("My type: " + type);
}
}
public class Goo {
....
}
And in Matlab:
com.toto.Foo.printClass(com.toto.Goo.class)
Which is actually not working.
Any solution for this ?
Edit: here is a working java example, the code in main should be executed under matlab:
public class Test
{
public static void main(String[] args)
{
Foo.printClass(Goo.class);
}
}
public class Foo
{
public static <E> void printClass(Class<E> type)
{
System.out.println("My type: " + type);
}
}
public class Goo {
public Goo() {};
}