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

Java Equivalent to VB SortedDictionary

The nearly exact Java equivalent to the .NET SortedDictionary collection is the TreeMap collection.

VB Java
Imports System.Collections.Generic

Sub SortedDictionaries()
    Dim map As New SortedDictionary(Of String, Integer)()
    Dim s As String = "test"
    map.Add(s, 1)
    Dim i As Integer = map(s)
    i = map.Count
    Dim b As Boolean = map.Count = 0
    map.Remove(s)
End Sub
void SortedDictionaries()
{
    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);
}


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.