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.

referenzen

Empfohlene Antworten

Veröffentlicht

Hallo ich hoffe ihr könnt mir helfen ich habe 3 Klassen 1. Grafische 1.Programm 1.Debug

mein problim liegt darin ich erstelle mit Debug xyz = new Debug() die instanz in der Grafischen klasse!

jetzt mus ich aber ürgend wie ne referenz in die Programm klasse bekommen aufgerufen wird diese bei mir so prog test = new prog(übergebene variblen);

wie bekomme ich das hin das ich ihn prog mit meiner instanz von grafik arbeiten kann? hoffe es gibt ne lösung weil einfach ne neue instanz kann ich nicht erstellen da ich z.b. von der grafischen klasse das debug level versetzen kann also muss ich damit arbeiten :-(

Gruß Badgott

Hm, es ist schwer zu verstehen, was du meinst. :confused:

Ich nehme an, du hast eine Klasse Programm die mit dem Debugobjekt aus der Klasse Grafik arbeiten soll.


class Programm

{

      Debug progDebug;


      methodexy()

      {

          Grafik meineGrafik = new Grafik(this)

      }


      //public um über die Referenz darauf zuzugreifen

      public void setDebug(Debug refToGrafikDebug)

      {

              progDebug = refToGrafikDebug;

      }


}


class Grafik

{



       public Grafik(Programm refToProgramm)

       {

             Debug grafikDebug = new Debug();

             //Objekt ist erzeugt und kann an Programm übergeben werden

            refToProgramm.setDebug(grafikDebug);

       }


}


class Debug

{


}

Du übergibst eine Instanz von Programm an Grafik über die du eine Methode in Programm aufrufen kannst. Dorthin übergibst du eine Instanz von Debug. Das ganze ist so, wie ich es geschrieben hab sehr abstrakt. Also kapseln nicht vergessen.

Emrep

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.