• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

Java Equivalent to VB Modules

The closest equivalent to a VB module is a final Java class with static members.  One difference is that VB allows you to specify module members from elsewhere in a project without qualifying the member call with the module name (VB to Java Converter inserts these qualifiers into the converted Java code).  Another difference is that you cannot instantiate a VB module.  To prevent instantiation in Java, just include a private constructor.

VB Java
Public Module ModuleTest
    Public Sub ModuleMethod()
    End Sub
End Module

Public Class UseModule
    Sub Method()
        ModuleMethod()
    End Sub
End Class
public final class ModuleTest
{
    public static void ModuleMethod()
    {
    }
}

public class UseModule
{
    public void Method()
    {
        ModuleTest.ModuleMethod();
    }
}


Use VB to Java Converter to convert from VB to Java.     

Additional resource: VB.NET and Java Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.