[email protected]:~/Desktop/Programming/Java/Encryption$ javac *.java Encrypt.java:10: incompatible types found : int required: java.lang.String String str = br.read(); ^ 1 error
This happens no matter what I set the data type to. My code is below if anyone is able to assist me on this.
import java.util.*;
import java.io.*;
public class Encrypt {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter string to be encrypted: ");
String str = br.read();
}
public static void readFile() throws Exception {
String text = "";
ArrayList<Key> encryptKey = new ArrayList<Key>();
Scanner read = new Scanner(new File("encrytionKey.txt"));
while(read.hasNext()) {
String character = read.next();
String endKey = read.next();
encryptKey.add(new Key(character, endKey));
}
for(int i = 0; i < encryptKey.size(); i++) {
encryptKey.get(i).print();
}
}
}

New Topic/Question
Reply


MultiQuote



|