Why does nothing display when I run my java code?

Viewed 39

When I run my java code on one computer it works fine but on the other nothing displays. When I type java CircleComputation it just returns to command line with nothing displaying but when I copy the file to another computer it works. Both have java installed and both have Path set. I can't find any difference in the computers.

Here is the code (not that it matters as I tried multiple programs):

/*
 * Print the area and circumferencee of a circle, given its radius double.
 */
public class CircleComputation {  // Saved as "CircleComputation.java"
   public static void main(String[] args) {
      // Declare variables
      double radius, area, circumference;
      final double PI = 3.14159265;
      
      // Assign a value to radius and height
      radius = 1.2;
     
      
      // Compute area and circumference
      area = radius * radius * PI;
      circumference = 2.0 * radius * PI;
      
      // Print results
      System.out.print("The radius is ");  // Print description
      System.out.println(radius);          // Print the value stored in the variable
      System.out.print("The area is ");
      System.out.println(area);
      System.out.print("The circumference is ");
      System.out.println(circumference);
   }
}
0 Answers
Related