Determine What Classes Define a Method
To display the fully qualified name of a method implemented by aloadedJava®class, call thewhich
函数。找到所有的类定义的规范ified method, usewhich
with the-all
qualifier.
For example, to find the package and class name for theconcat
method, type:
whichconcat
If thejava.lang.String
class is loaded, MATLAB®displays:
concat is a Java method % java.lang.String method
If theString
class has not been loaded, MATLAB displays:
concat not found.
Suppose that you loaded the JavaString
andjava.awt.Frame
classes. Both of these classes have anequals
method. Type:
which -all equals
The MATLAB display includes entries like these:
equals is a Java method % java.lang.String method equals is a Java method % java.awt.Frame.equals equals is a Java method % com.mathworks.jmi.MatlabPath method
Thewhich
function operates differently on Java classes than it does on MATLAB classes:
which
always displays MATLAB classes, whether they are loadedwhich
only displays Java classes that are loaded
You can find out which Java classes are currently loaded by using the command[m,x,j]=inmem
.