• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

! in front of a boolean variable

Hi Guys,
            What does "!" mean in front of a boolean variable,
eg.

       if (!method.IsPublic)
            {
                return false;
            }


Thank you,
Serge
0
Autofreak
Asked:
Autofreak
  • 2
2 Solutions
 
hongjunCommented:
It is to negate it
0
 
hongjunCommented:
That's

if method.IsPublic is true, then !method.IsPublic will give you false and vice versa
0
 
mrichmonCommented:
Note this does not just apply to boolean variables.  ! means not.  So therefore when you see != it means not equal.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now