221k views
5 votes
Which of the following is the java comparison operator for "not equal to"

1 Answer

1 vote
You need to provide "the following", otherwise other users cannot answer your question.

However, the Java operator for "not equal to" is "!=".


// For example.
if (1 != 2) {
System.out.println("1 doesn't equal 2");
}


The if-statement in the code above will always run, since 1 is not equal to 2.
User QHarr
by
6.6k points