We know the area of a triangle can be obtained by the formula 0.5 X base X height. Means half of the product of its height and base. The below program demonstrated how to find area of a triangle using java program for beginners.

If you want to learn Java from Beginning please Click Here.

public class Project3{
public static void main(String args[])
float base=5f;
float height=10f;
float area = 0.5f*base*height;
System.out.println(“Area of triangle =”+area);