【发布时间】:2016-08-07 17:34:51
【问题描述】:
在我的代码中,我在其中放置了一个 main 方法。该程序在 jgrasp 上编译,没有错误。但它一直给我一条消息:“在文件 jgrasp 中找不到主要方法、小程序或 Midlet”
import java.io.*;
public class XOREncyrption
{//start of class
public static void Main(String [] args)
{//start of main
File f = new File("data.txt");
File g = new File("key.txt");
try
{
FileInputStream r = new FileInputStream(f);
FileInputStream x = new FileInputStream(g);
byte [] me = new byte [(int)f.length()];
byte [] we =new byte [(int)g.length()];
int why = r.read(me);
int where =x.read(we);
//input.close();
}
catch(FileNotFoundException e)
{
System.out.print("No file");
}
catch(IOException e)
{
System.out.println("error");
}
}//end of main
}//end of class
如果有人能弄清楚为什么代码告诉我有一个 main 方法时没有 main 方法,我将不胜感激。
【问题讨论】: