This is possible with the replaceAll function.
(?<!^).(?=.*?.@)
*
DEMO
String s = "example@gmail.com";
System.out.println(s.replaceAll("(?<!^).(?=.*?.@)", "*"));
:
e*****e@gmail.com
Update:
, e*****e@g***l.com
String s = "example@gmail.com";
System.out.println(s.replaceAll("\\B.\\B(?=.*?\\.)", "*"));
:
e*****e@g***l.com