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

VB Equivalent to Java Functional Interfaces

The closest VB equivalent to Java's functional interfaces are VB delegates.

Java VB
@FunctionalInterface
public interface FooFunctional
{
    void invoke();
}

public class UseFunctionalInterface
{
    void method()
    {
        FooFunctional funcVar = () -> voidMethod();
        funcVar.invoke();
    }
    void voidMethod()
    {
    }
}
Public Delegate Sub FooFunctional()

Public Class UseFunctionalInterface
    Friend Overridable Sub method()
        Dim funcVar As FooFunctional = Sub() voidMethod()
        funcVar()
    End Sub
    Friend Overridable Sub voidMethod()
    End Sub
End Class


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


Copyright © 1997 – 2017 Tangible Software Solutions Inc.