java - Variable assignment operator -= -


this question has answer here:

i'm in need me explain fragment of code.

graphics2d g2d = (graphics2d) g;//create graphics object g2d int x = 200; int y = 150; point2d.double start = new point2d.double(x, y); x -= 50; point2d.double end = new point2d.double(x, y); 

i know first 3 lines says x -=50, don't understand doing there.

could please explain me.

x -= y syntactic sugar x = x - y.

so x -= 50; subtract 50 x.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -