Question: how to calculate the perimeter of a triangle in java?
Answer: In the next Java line, we used a mathematical formula to calculate the Perimeter of the Triangle using the formula P = a + b + c. s = (a + b + c)/2; Next, we are calculating the area of a triangle using Heron's Formula. Here Math.