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
  • 30,779
  • 11
  • 72
  • 106
James Raitsev
  • 92,517
  • 154
  • 335
  • 470

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
  • 30,779
  • 11
  • 72
  • 106
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
  • 39,895
  • 28
  • 133
  • 186
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,706
  • 9
  • 36
  • 50