Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
491 views
in Technique[技术] by (71.8m points)

operators - What is <-- in Java?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

<-- is not a new Java operator (even though it may look like it), but there are 2 normal operators: < and --

while (var2 <-- var1) is the same as while(var2 < (--var1)), which can be translated to plain english as:

  1. decrement the var1 variable ( --var is a prefix decrementation, ie. decrement the variable before condition validation)
  2. Validate the condition var2 < var1

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...