Example: MethodName property

This script prints out the position within the collection where there is a toString method.

Dim mySession As JavaSession
Dim myClass As JavaClass
Dim myMethod As JavaMethod
Dim myMCollection As JavaMethodCollection
Dim msg As String
	
Set mySession = new JavaSession()
msg = " "

' Get Java "java.lang.Integer" class
Set myClass = mySession.GetClass("java/lang/Integer")

' Get a list of all methods belonging
' to the java.lang.Integer class
Set myMCollection = myClass.getClassMethods()

set myMethod = myMCollection.getFirst()
do
	if myMethod.MethodName = "toString" then
		msg = msg + {
			toString } & myMethod.Signature & _
           { is located at element } 	& _
           myMCollection.Current & _
           { within the collection}
	End If
	set myMethod = myMCollection.getNext()

loop while myMCollection.Current <> 1
' Because getNext loops back to 1 when the end is reached

MessageBox msg