### Inline Java Class Definition

To use the methods defined in an Inline Java Class, the class must be initialized using the
Package Name . Main Class . Inline Java Class Name
Example:
Package name: b4j.example
Main Class: Main
Inline Java Class Name: TestClass
To access the methods from the TestClass, use "b4j.example.main.TestClass".
Example Class
`Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
Try
'init the new inline class using packagename.main.thenewclassname
joInline.InitializeStatic("b4j.example.main.TestClass")
Dim s As String = joInline.RunMethod("HelloWorld_Main", Null)
Log(s)
Catch
Log(LastException.Message)
End Try
MainForm.Close
End Sub`
If JAVA
public static class TestClass {
//The method must be declared as static method
public static String HelloWorld_Main() {
return "Hello World from Main Class!";
}
}
End If

Changed: , Category: Inline Java, File: T6C201M1471.htm, ID: 1471