Find the concentration of a solution using given Mass and Volume | Java program to find concentration of a solution using given Mass and Volume ; Function to calculate concentration from the given mass of solute and volume of a solution ; Driver code
class GFG { static double get_concentration ( double mass , double volume ) { if ( volume == 0 ) return - 1 ; else return ( mass / volume ) * 1000 ; } public static void main ( String [ ] args ) { double mass , volume ; mass = 100.00 ; volume = 500.00 ; System . out . println ( get_concentration ( mass , volume ) ) ; } }