Java常见面试题(一)
七月 27, 2010 | 677 views 1 comment
1 实现一个 字符串的 reverse函数和 replace函数.
reverse:
public static void stringReverser() {
String strOld = “aaabbb”;
String strNew = new StringBuffer(a).reverse().toString();
System.out.println(strNew);
}
replace:
public static String replace(String text, String repl, String with) {
if ((text == null) || (repl == null) || (with == null)
|| (repl.length() == 0) || (max == 0)) {
return text;
}
StringBuffer buf = [...]
Posted in java学习 | Tags: java 注意事项 面试题 知识点