עבור לתוכן
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.

איך אני עושה ."OR"/|| ל-STRING בJAVA?

Featured Replies

פורסם

קודם כל אני מתנצל שאני חורג מכללי הקוד, הקוד פשוט עצום, יש בכל זאת צורך להדביק אותו פה?

דבר שני, יש לי את השורה הזאת:

String x;
if (x="yes" || "YES" || "Yes")

כאשר השורה השנייה מסומנת לי והשגיאה היא:

operator || cannot be applied to boolean java.lang.string

אם לא זה, אז מה?

פורסם

i

f (x=="yes" || x== "YES" || x== "Yes");

פורסם
  • מחבר

פפפששש עובד מצויין :xyxthumbs:

פורסם

אני אולי טועה אבל השוואה של סטרינג לא אמורה להתבצע דרך "str.equals(str2)"?

וכן בבוליאני תמיד שני סימני "=" (אלא אם כן יש לך סימן של גדול/קטן/שונה).

פורסם
  • מחבר

יש פקודה שסוגרת חלון?

הכוונה פתחתי חלון דרך println, יש פקודה שסוגרת אותו?

ויש פקודה שקובעת את גודל החלון שיפתח?

או לעשות לו ALL WAYS ON TOP?

פורסם

יש דרך יותר כללית לעשות את זה


if(x.toLowerCase()=="yes") ...;

;)

ארכיון

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

דיונים חדשים

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.