I am trying to write a program that takes the word Mississippi and replaces all the i's with !'s and all s's with $'s. It doesnt allow me to compile the code because it says something about a syntax error on token "!". Here is the code so far:
public class Replace { public static void main(String[] args) { String word = "Mississippi" ; String word2 = word.replace(i, !) ; String word3 = word2.replace(s, $) ; System.out.println(word3); } }
Could anyone help?