האם יש פעולה מובנית בתוך JAVA לבדוק שאין חריגה ממערך מסויים? - עמוד 2 - תכנות - HWzone פורומים
עבור לתוכן
  • צור חשבון

האם יש פעולה מובנית בתוך JAVA לבדוק שאין חריגה ממערך מסויים?


wais_asss

Recommended Posts

אבל במשהו אחד אתה טועה

כן, אבל לא בזה אלא בזה -

BITWISE OPERTORS - יודעים לעבוד על סוג משתנים שונים מINT

bitwise operators עובדים גם על booleans. מה שיכול להכניס שגיאות בדיוק במקרים שלא מבינים את ההבדלים, ולכן חשבתי שהורידו את זה ב- java.

קישור לתוכן
שתף באתרים אחרים

ואז מתורגם חזרה לבוליאני בשביל ה-if?

הממ.. כנראה שלא.

זה מהאתר של Sun

15.22.2 Boolean Logical Operators &, ^, and |

When both operands of a &, ^, or | operator are of type boolean, then the type of the bitwise operator expression is boolean.

For &, the result value is true if both operand values are true; otherwise, the result is false.

For ^, the result value is true if the operand values are different; otherwise, the result is false.

For |, the result value is false if both operand values are false; otherwise, the result is true.

http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html

קישור לתוכן
שתף באתרים אחרים

ארכיון

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

×
  • צור חדש...