Find the volume of rectangular right wedge | Java implementation of the approach ; Function to return the volume of the rectangular right wedge ; Driver code
class GFG { static double volumeRec ( double a , double b , double e , double h ) { return ( ( ( b * h ) / 6 ) * ( 2 * a + e ) ) ; } public static void main ( String [ ] args ) throws java . lang . Exception { double a = 2 , b = 5 , e = 5 , h = 6 ; System . out . print ( " Volume ▁ = ▁ " + volumeRec ( a , b , e , h ) ) ; } }