Program 4.5: The energy equivalent of the mass of an electron
Program 4.5 calculates the energy equivalent of an electron using Einstein's famous formula
E = mc2.
class mc2 {
public static void main (String args[]) {
double mass = 9.1096E-25;
double c = 2.998E8;
double E = mass * c * c;
System.out.println(E);
}
}