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.

Empfohlene Antworten

Veröffentlicht

Hey leute ich hab ein ganz einfaches Programm aber das prgramm gibt irgendwie nur mist aus.


public class lol

{

public static void main()

{

   int[] n = {-5,4,9,8,1,0,9};


   System.out.println(n);

}

}

eigentlich soll nur der Arry mit den werten ausgeben werden, aber stattdessen wird zum beispiel sowas ausgeben [i@11e0c13

Kann mir einer sagen worand das liegt?^^

Bearbeitet von flashpixx
Code-Tags eingefügt

Woher das System.out.println() wissen, welche Zahl du ausgeben willst?

Du gibst momentan die Speicheradresse des Arrays aus und nicht die Werte.

Bitte mal nachlesen, wie man auf Arrays zugreift.

Woher das System.out.println() wissen, welche Zahl du ausgeben willst?

Du gibst momentan die Speicheradresse des Arrays aus und nicht die Werte.

Bitte mal nachlesen, wie man auf Arrays zugreift.

Hier kannst du alles nachlesen!

Ps.: Sry code Block Funktion funzt bei mir gerade nicht :(

Galileo Computing :: Java ist auch eine Insel (8. Auflage) – 3.10 Arrays

int[] primes = { 2, 3, 5, 7, 7 + 4, };

for ( int i = 0; i < primes.length; i++ ) // Index: 0 <= i < 5 = primes.length

System.out.println( primes[ i ] );

*sry dachte hab die edit funktion erwischt* :rolleyes:

int[] primes = { 2, 3, 5, 7, 7 + 4, };

for ( int i = 0; i < primes.length; i++ ) // Index: 0 <= i < 5 = primes.length

System.out.println( primes[ i ] ); 

Bearbeitet von pleq

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.