• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

compound assignment operator doubt

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the folowing are compound assignment operator.
*=, /=, %=,+=, -=, <<=, >>=,
>>>=, &=, ^=, |=

why remaining operator's are not included in compound assignment operator.
if i use these operator &&=, >= in expression, i am geting compile time error.
please explain me reason for this.
 
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Compound assignment operator is NOT possible for those operators which return ONLY boolean value.

Operators like conditional AND or Conditional OR returns boolean value only dats y u can't use compound assignment with conditional AND or OR.

&&= not legal.

Logical/bitwise operators can return boolean (called Logical Operators) or integer (called bitwise operators).







Thanks


Naseem Khan
reply
    Bookmark Topic Watch Topic
  • New Topic