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

Java Equivalent to VB Shared Constructors

The Java equivalent to a VB shared constructor is a 'static initializer block'.

VB Java
Class Foo
    Public Shared field As Integer

    Shared Sub New()
        field = 1
    End Sub
End Class
class Foo
{
    public static int field;

    static
    {
        field = 1;
    }
}


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.