Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Java --> C# Was ist ein Vector?

Empfohlene Antworten

Veröffentlicht

Hallo Freaks!

Also ich sitze gerade im Praktikum und soll ein kleines Java Programm in C# umwandeln. Nun hänge ich fest.

Was wird in C# aus einem Vector?

Für schnelle Antwort wäre ich sehr dankbar

Gruß

Kristof

Ich würde jetzt mal sagen, daß die .NET-Klasse ArrayList dem Java-Vector entsprechen.

Gruß

Damit komme ich leider nicht weiter.

Versteh ich jetzt net.

Aus

Vector v = new Vector();


v.addElement("string 2");

v.addElement("string 4");

v.insertElementAt("string 1", 0);

v.insertElementAt("string 3", 2);

v.addElement("string 5");


for (int i=0; i<v.size(); i++) {


String s = (String) v.elementAt(i);

System.out.println(s);


}


while (!v.isEmpty()) {


String s = (String) v.removeElementAt(0);

System.out.println(s);


}
wird
ArrayList v = new ArrayList();


v.Add("string 2");

v.Add("string 4");

v.Insert(0,"string 1");

v.Insert(2,"string 3");

v.Add("string 5");


for (int i=0; i<v.Count; i++) 

{

	string s = (string)v[i];

	Console.WriteLine(s);

}


while (v.Count != 0) 

{


	string s = (string)v[i];

	v.RemoveAt(0);

	Console.WriteLine(s);


}

ja war mein Fehler. Es läuft

Danke

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.