- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Java Program to calculate area of a Tetrahedron

A Tetrahedron is a polyhedron composed of four triangular faces, six straight edges, and four vertex corners.

Following is the Java program to calculate area of a Tetrahedron −

## Example

import java.io.*; public class Demo{ static double tetra_vol(int side){ double my_vol = (Math.pow(side, 3) / (6 * Math.sqrt(2))); return my_vol; } public static void main(String[] args){ int side = 4; double my_vol = tetra_vol(side); my_vol = (double)Math.round(my_vol * 100) / 100; System.out.println("The area of tetrahedron is"); System.out.println(my_vol); } }

## Output

The area of tetrahedron is 7.54

A class named Demo contains a static function named 'tetra_vol' which takes 'side' as a parameter. The formula to calculate area of a tetrahedron is ‘side’ cube/(6v2). This is computed and the output is returned. In the main function, the value of size is defined, and the function is called on this value. The output is printed on the console.

- Related Questions & Answers
- Program to calculate the area of a Tetrahedron
- Program to calculate area and volume of a Tetrahedron
- Python Program to calculate the area of a Tetrahedron
- Program to calculate area of Enneagon
- Program to calculate Area Of Octagon
- Program to calculate area and perimeter of Trapezium
- Java Program to calculate the area of a triangle using Heron's Formula
- Program to calculate area and perimeter of equilateral triangle
- Program to calculate area of Circumcircle of an Equilateral Triangle
- Program to calculate the area of an Circle inscribed in a Square
- Program to calculate area and perimeter of equilateral triangle in C++
- Program to calculate area of Circumcircle of an Equilateral Triangle in C++
- How to Calculate the Area of a Triangle using Python?
- Java program to find the area of a square
- Java program to find the area of a rectangle

Advertisements