A Graphics graphics context allows you to draw straight lines using drawLine with integer coordinates.
Graphics
drawLine
A Graphics2D graphics context allows you to draw not only straight lines, but also quadratic curves and Bezier curves.
Graphics2D