找不到主要方法,小程序或MIDlet

时间:2016-04-05 20:09:11

标签: java jgrasp main-method

当我运行这个弹出窗口时,告诉我没有主要的方法,小程序或MIDlet。有人可以告诉我为什么请? - 我正在使用jGrasp。我正在尝试使用main方法,我之前没有遇到过这个问题。

import java.util.*;
import java.io.*;


public class ProgrammingExercise3.1
{
   public static void main(String[] args);
   {

      double rectWidth;
      double rectLength;
      double radius;
      int age;
      double begBal;
      char A;
      String name;
      double rate;

      scanner inFile = new Scanner(new FileReader("C:\\Users\\sierr_000\\Desktop\\Sam School\\IT-145\\Exercises\\Ch 3\\inData.txt"));

      PrintWriter outFile = new PrintWriter("C:\\Users\\sierr_000\\Desktop\\Sam School\\IT-145\\Exercises\\Ch 3\\outData.out");

      rectWidth = inFile.next();
      rectLength = inFile.next();

      outFile.println("Rectangle: ")
      outFile.println("Length = " + rectLength + ", width = " + rectWidth + ", area = "
                     + (rectWidth*rectLength) + ", perimeter = " + (2 * (rectwidth + rectLengh)));

      radius = inFile.next();

      outFile.println("Circle: ");
      outfile.println("Radius = " + radius + ", area = " + (radius*3.1416) + "Circumfrence = " + (2*3.1416*radius));

      name = inFile.next();
      age = inFile.next();
      begBal = inFile.next();
      rate = inFile.next();

      outFile.println("Name: " + name + ", age: " + age);
      outFile.printf("Beginning Balance: %7.2f" , begBal + "interest rate: %4.2f" , rate);
      outFile.println("The character that comes after A in the ASCII is B");      




      inFile.close();
      outFile.close();

   }
}   

1 个答案:

答案 0 :(得分:0)

这似乎充满了错误,但是你得到错误的主要原因是你在public static void main(String[] args)之后加了一个分号。