1. Getting started
2. Calling methods
3. Working with .NET Objects
4. Fields and Properties
5. Methods Arguments
6. Nested Types
7. Enums
8. Arrays and Collections
9. Embeding UI controls
10. Referencing libraries
11. Off-line activation
12. Events and Delegates
13. Disposing and Garabage Collection
14. .NET Configuration Files (AppConfig, WebConfig)
15. Exceptions, Debugging and Testing
16. Strongly-Typed Wrappers
    17. Advanced Activation and Licensing
    18 Other usage scenarios

      Creating Instance and Calling Instance Methods

      JavOnet lets you create instances of any .NET type. To store reference of a particular .NET object, the Javonet-created NObject Java type can be used by variables of any .NET object.

      To create an instance of a .NET object, call the Javonet.New method. Once called, you’ve created a reference to that object that could be assigned to NObject variable, which you can then use to perform any operations on that object.


      Here’s how to call “Next” method on instance of .NET “Random” class:

        NObject objRandom = Javonet.New("System.Random");
        Integer value = objRandom.invoke("Next",10,20);

      JavOnet calls are very similar to regular .NET or Java calls, with a little bit of reflection style. Value-type results are automatically converted into Java types so you can safely assign them to Java variables. Reference-type results must be assigned to NObject variable.

      Any calls to .NET objects using Javonet can be shortened and simplified using our Fluent interface. To find out more, click here.

      See Live Example!