• Saves Valuable Time
  • Trusted Accuracy for 14 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();
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
End Sub

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

Additional resource: VB.NET and Java Equivalents

Copyright © 1997 – 2018 Tangible Software Solutions, Inc.