例: getNth メソッド (JavaPropertyCollection クラス)

次のスクリプトは、JavaClass オブジェクトに属するプロパティをすべて出力します。

Dim mySession As JavaSession
Dim myClass As JavaClass
Dim myPCollection As JavaPropertyCollection
Dim i As Integer
		
Set mySession = new JavaSession()

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

' Get a list of all Properties belonging
' to the java.lang.Integer class
Set myPCollection = myClass.getClassProperties()

Print myPCollection.count & "Properties of the " _
	& myClass.ClassNAme & " class are :"
For i = 1 to myPCollection.count
	Set myProperty = myPCollection.getNth(i)
	Print myProperty.PropertyName & " (" & _
  myPCollection.current & ")"
next i