12

I ran across this example and realized i don't fully understand what's going on here

if (a <- b) {
    return false;
}

What is <- in Java?

Alberto Zaccagni
  • 29,658
  • 11
  • 72
  • 103
James Raitsev
  • 87,465
  • 141
  • 322
  • 462

3 Answers3

27

See it in this way:

if (a < -b) {
    return false;
}

There is no <- operator in java.

Related, I've just found this question: What is the "-->" operator in C++?

Community
  • 1
  • 1
Alberto Zaccagni
  • 29,658
  • 11
  • 72
  • 103
4

There is no such operator in java. This means

if (a < -b) {

}

which is same as

if (a < -         b) {

}

The - sign need not be just by b.

For int types one could do

if (a <-- b) {

}

which will be same as

if (a < --b) {

}
fastcodejava
  • 37,849
  • 27
  • 129
  • 182
0

This kind of stuff is possible.but there is no <- operator in java.it can be -b

int a=4; int b=-5;

if(a<-b){
    System.out.println("ela");
}
Sanjaya Liyanage
  • 4,526
  • 9
  • 35
  • 50