Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.ch01;
- public class TestJava1 {
- public static void main(String[] args) {
- String str = "這是一個測試字串";
- System.out.println(str.indexOf('測'));
- System.out.println(str.indexOf('空'));
- char ch1 = '字';
- System.out.printf("a. ch1 -> %d\n", (int) ch1);
- int in1 = 23383;
- System.out.printf("b. in1 -> %c\n", (char) in1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement