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 {
44 private static final String ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; //Encapsulate and make the alphabet immutable
55 private static int key = 25 ; //Initialize and encapsulate the shift key
66 private static String encryptedMsg ; //Create and encapsulate the message container
7+ private static String decryptedMsg ;
78
8- public String encrypt (String msg ){
9- String upCased = msg .toUpperCase ();
9+ public String encrypt (String encryptMsg ){
10+ String upCased = encryptMsg .toUpperCase ();
1011 char [] upCasedArrs = upCased .toCharArray ();//split the string to a character array
1112 ArrayList <Character > encryptedChars = new ArrayList <Character >();
1213
@@ -20,4 +21,8 @@ public String encrypt(String msg){
2021 return encryptedMsg ;
2122 }
2223
24+ public String decrypt (String decryptMsg ){
25+ return decryptMsg .toUpperCase ();
26+ }
27+
2328}
You can’t perform that action at this time.
0 commit comments