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.

TextString in ein Array einfügen

Empfohlene Antworten

Veröffentlicht

Hi Leute, kann mir vielleicht jemand sagen, wie ich in Java ein TextString in ein Array einfügen kann. OHNE es dabei in einen (zb. Integer Wert) umzuwandeln !?!?!

Gruß

Kasamasch :marine

Wie wäre es...

a) mit Grundlagenforschung:

"Java ist auch eine Insel", Thema: Arrays

oder

B) hiermit:

String deinString = "Mumpitz Blubb";

String[] deinArray = new String[] {deinString};

Nebenbei: Arrays haben nichts mit primitiven Datentypen (wie int, char, etc.) zu tun. Arrays sagen lediglich aus, dass du eine Liste eines ganz bestimmten Datentyps hast. Wie obiges Beispiel zeigt, kann man auch von komplexen Datentypen (Klassen) Arrays bilden.

Wenn du allerdings in ein Integer-Array ein String-Objekt zu setzen gedenkst, muss ich fragen, was du überhaupt vorhast, da dies nicht möglich ist.

Eine Alternative ist die Verwendung des Collection-Frameworks.

Gruß.

Arvid.

Ich habe vor, ein Textfile auszulesen und will dann einzelnen Strings daraus in ein Array abspeichern. Es kann sein dass ich da was vorhabe, was nicht möglich ist oder sehr aufwendig, keine ahnung. Java ist für mich Neuland.

Vielen DANK für deine Hilfe, ich werde es gleich ausprobieren und melde mich, wenn es geklappt hat.

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.