When ! is used in Java

Asked 2 years ago, Updated 2 years ago, 26 views

If you look at the codes, say if (!s.add(a))!""I've seen things like equals (Ninput.getText() What do you mean by interpreting this? If ! is in front of you, it's my first time seeing it, so I'm asking you a question.

And if (!s.add(a))), then the add method is executed, and there are two things that happen as a whole, whether the condition is true or false?

java

2022-09-22 18:28

1 Answers

! is a logical operator If the expression A is 'true' then !A denotes 'false'.

In other words, an operator that turns true to false, false to true.


2022-09-22 18:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.