Any ideas why I keep getting a runtime error with this? I am very new, please go easy on me. I am trying to accept user input to generate a very simple encryption of a file. I am getting an error:
Static Error: This class does not have a static void main method accepting String[].
I have a main methor accepting string[]! I am lost. Any suggestions?
import java.io.*;
import java.util.Scanner;
public class Encryption
{
public static void main(String[] args, String existing, String encrypted) throws IOException
{
boolean eof = false;
int key = 10;
Scanner scan = new Scanner(System.in);
key = scan.nextInt();
/* Your encryption program should work like a filter, reading the contents of one file...
*/
FileInputStream inStream = new FileInputStream(existing);
DataInputStream inFile = new DataInputStream(inStream);
FileOutputStream outStream = new FileOutputStream(encrypted);
DataOutputStream outFile = new DataOutputStream(outStream);
while (!eof)
{
try
{
byte input = inFile.readByte();
/* modifying the data into a code...
*/
input += key;
/* and then writing the coded contents out to a second file.
* The second file will be a version of the first file, but written in a secret code.
*/
outFile.writeByte(input);
}
catch (EOFException e)
{
eof = true;
}
}
}
}