עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

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 | גישה למופע של CLASS

Featured Replies

פורסם

חברים שלום,

שאלה קטנה בנוגע לגישה במופע של CLASS.

יש לי 3 CLASS-ים..

class Main

- class Bהמכיל 2 משתנים (int, string) שניהם private וכמובן יש getters ו setters לשני המשתנים.

class A + מתודה כלשהי

מה main מייצרים מופע של B בשם b עושים פעולה כלשהי ומכניסים שם ל string של b.

לאחר מכן מייצרים מופע של A בשם a ונכנסים למתודה כלשהי ב a שעושה חישוב מתמטי, את תוצאת החישוב אני מעוניין להכניס למופע של b בתור ה int.

האם הדבר אפשרי? ואם כן אז אשמח לדעת איך..

תודה מראש לעוזרים![br]פורסם בתאריך: 12.05.2009 בשעה 18:40:20


נראה לי שפתרתי את הבעיה.. (עדיין לא הרצתי את הקוד אבל eclipse לא רושם error)

פשוט לשלוח למתודה את B b..

האם זאת הדרך לפתור?

פורסם

נגיד שהאובייקט של A הוא aa והאובייקט של B הוא bb

ב main אתה רושם

 bb.setINT(aa.methoda())

פורסם
  • מחבר

תודה על התגובה..

הסתדרתי כבר ע"י שליחת ה CLASS דרך המתודה..

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

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.