Following methods are used to draw a straight line on a Canvas:
- moveTo(x,y) – It defines the starting co-ordinates of the line
- lineTo(x,y) – It defines the ending co-ordinates of the line
- The actual line is drawn with the help of a method like stroke()