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

VB Equivalent to Java TreeMap

The nearly exact VB (or C#) equivalent to Java's TreeMap collection is the .NET System.Collections.Generic.SortedDictionary collection.

Java VB
void TreeMaps()
{
    java.util.TreeMap<String, Integer> map = new java.util.TreeMap<String, Integer>();
    String s = "test";
    map.put(s, 1);
    int i = map.get(s);
    i = map.size();
    boolean b = map.isEmpty();
    map.remove(s);
}
Imports System.Collections.Generic

Sub TreeMaps()
    Dim map As New SortedDictionary(Of String, Integer?)()
    Dim s As String = "test"
    map(s) = 1
    Dim i As Integer = map(s)
    i = map.Count
    Dim b As Boolean = map.Count = 0
    map.Remove(s)
End Sub


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

Additional resource: VB.NET and Java Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.