MCPcopy Create free account
hub / github.com/DuGuQiuBai/Java / main

Method main

day12/code/day12_String/src/cn/itcast_04/StringTest.java:7–29  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

5 */
6public class StringTest {
7 public static void main(String[] args) {
8 String s = "java";
9
10 // ͨ��charAt()�������λ�ȡ�ַ�
11 // System.out.println(s.charAt(0));
12 // System.out.println(s.charAt(1));
13 // System.out.println(s.charAt(2));
14 // System.out.println(s.charAt(3));
15
16 // ���ǣ�����ַ����ĸ����Ƚ϶࣬����ͻ���鷳�������ظ��Ⱥܸ�
17 // for (int x = 0; x < 4; x++) {
18 // System.out.println(s.charAt(x));
19 // }
20
21 // ����ַ����ݽ϶࣬�������������ԣ�����Ҫ��һ����ȡ�ַ������ķ���
22 // length();
23 for (int x = 0; x < s.length(); x++) {
24 // System.out.println(s.charAt(x));
25
26 char ch = s.charAt(x);
27 System.out.println(ch);
28 }
29 }
30}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected