I was just making a small file to encrypt data entered by user by using the Key:
Here's the code:
import java.io.*;
public class Encryption{
public static void main(String[]args)throws IOException{
InputStreamReader instream=new InputStreamReader(System.in);
BufferedReader hash=new BufferedReader (instream);
System.out.println ("Plz enter string");
String s=hash.readLine();
System.out.println("Plz enter the Key");
int key=hash.readInt();
int x;
for (int i=0; i<s.length(); i++){
int x= (char)s.char At(i) + key;
System.out.println(x);
}
}
}
}
I don't know there are alotta errors (4)
Identifier in line (12) and <expression> in line 12
the main problem is mainly in line (12) but I can't figure it out, I've tried alotta things but it ain't working ://
Question
MostafaKamel
Hey guys,
I was just making a small file to encrypt data entered by user by using the Key:
Here's the code:
import java.io.*; public class Encryption{ public static void main(String[]args)throws IOException{ InputStreamReader instream=new InputStreamReader(System.in); BufferedReader hash=new BufferedReader (instream); System.out.println ("Plz enter string"); String s=hash.readLine(); System.out.println("Plz enter the Key"); int key=hash.readInt(); int x; for (int i=0; i<s.length(); i++){ int x= (char)s.char At(i) + key; System.out.println(x); } } } }I don't know there are alotta errors (4)
Identifier in line (12) and <expression> in line 12
the main problem is mainly in line (12) but I can't figure it out, I've tried alotta things but it ain't working ://
Edited by MostafaKamelLink to comment
Share on other sites
4 answers to this question
Recommended Posts