How do I instantiate a java interface from matlab?
3 views (last 30 days)
Show older comments
I am trying to instantiate an interface of a java class. In java I would:
Class.IInterface newinterface = new
(I think)... But how can I do this within the matlab syntax?
1 Comment
Richard Alcock
on 3 May 2011
Is you example missing something - it ends rather suddenly, and isn't currently valid Java.
Answers (2)
Andy Zelenak
on 11 Oct 2019
Edited: Andy Zelenak
on 11 Oct 2019
I can confirm that it is possible to do this. I've used javaMethod(...) to call public static methods of a Java class which implements an interface. It didn't seem to take any unusual setup effort.
0 Comments
See Also
Categories
Find more on Call Java from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!