File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,10 @@ public class CaesarShift {
4
4
private static final String ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; //Encapsulate and make the alphabet immutable
5
5
private static int key = 25 ; //Initialize and encapsulate the shift key
6
6
private static String encryptedMsg ; //Create and encapsulate the message container
7
+ private static String decryptedMsg ;
7
8
8
- public String encrypt (String msg ){
9
- String upCased = msg .toUpperCase ();
9
+ public String encrypt (String encryptMsg ){
10
+ String upCased = encryptMsg .toUpperCase ();
10
11
char [] upCasedArrs = upCased .toCharArray ();//split the string to a character array
11
12
ArrayList <Character > encryptedChars = new ArrayList <Character >();
12
13
@@ -20,4 +21,8 @@ public String encrypt(String msg){
20
21
return encryptedMsg ;
21
22
}
22
23
24
+ public String decrypt (String decryptMsg ){
25
+ return decryptMsg .toUpperCase ();
26
+ }
27
+
23
28
}
You can’t perform that action at this time.
0 commit comments