interface PhysicalConstants {
// Avogadro's number (1/mol)
static final double AVOGADROS_NUMBER = 6.02214199e23; // Boltzmann constant (J/K)
static final double BOLTZMANN_CONSTANT = 1.3806503e-23; // Mass of the electron (kg)
static final double ELECTRON_MASS = 9.10938188e-31;
}public class PhysicalMethods implements PhysicalConstants { public double getIdealGasVolume(double pressure, long numberOfMolecules,
double temperature) {
return ((numberOfMolecules / AVOGADROS_NUMBER) * AVOGADROS_NUMBER
* BOLTZMANN_CONSTANT * temperature)
/ pressure;
} // some other methods doing physical calculations go here...}
// Avogadro's number (1/mol)
static final double AVOGADROS_NUMBER = 6.02214199e23; // Boltzmann constant (J/K)
static final double BOLTZMANN_CONSTANT = 1.3806503e-23; // Mass of the electron (kg)
static final double ELECTRON_MASS = 9.10938188e-31;
}public class PhysicalMethods implements PhysicalConstants { public double getIdealGasVolume(double pressure, long numberOfMolecules,
double temperature) {
return ((numberOfMolecules / AVOGADROS_NUMBER) * AVOGADROS_NUMBER
* BOLTZMANN_CONSTANT * temperature)
/ pressure;
} // some other methods doing physical calculations go here...}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货