Java tutorial
//package com.java2s; public class Main { public static String maskString(String s) { StringBuilder stringbuilder = new StringBuilder(s.length()); for (int i = 0; i < s.length(); i++) { stringbuilder.append("*"); } return stringbuilder.toString(); } }