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
Post a Comment