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

Java Equivalent to C# List

The nearly exact Java equivalent to the .NET List collection is the ArrayList collection.

C# Java
using System.Collections.Generic;

void Lists()
{
    List<int> myList = new List<int>();
    myList.Add(1);
    myList.Insert(1, 2);
    int i = 1;
    myList[0] = i;
    i = myList[0];
}
void Lists()
{
    java.util.ArrayList<Integer> myList = new java.util.ArrayList<Integer>();
    myList.add(1);
    myList.add(1, 2);
    int i = 1;
    myList.set(0, i);
    i = myList.get(0);
}


Use C# to Java Converter to convert from C# to Java.     

Additional resource: Java and C# Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.