📄 main.java
字号:
import java.text.StringCharacterIterator;class Main { public static void main(String args[]) { String str = "Hello world"; // create string character iterator StringCharacterIterator iter = new StringCharacterIterator(str, 6); printValues(iter); // prints '6' and 'w' // create a clone StringCharacterIterator iterCopy = (StringCharacterIterator)iter.clone(); printValues(iterCopy); // prints '6' and 'w' if(iter.equals(iterCopy)) { System.out.println("Copy is equal to original"); } else { System.out.println("Copy is not equal to original"); } // compute hashcode int hc = iter.hashCode(); System.out.println("Hash code is: " + hc); } public static void printValues(StringCharacterIterator it) { System.out.println(it.getIndex()); System.out.println(it.current()); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -