当前位置:  首页>> 技术小册>> Java语言基础9-常用API和常见算法

示例:

  1. package com.github.string.demo1;
  2. /**
  3. * @author maxiaoke.com
  4. * @version 1.0
  5. */
  6. public class Test {
  7. public static void main(String[] args) {
  8. // 字面量的定义方式
  9. String s1 = "123";
  10. String s2 = "123";
  11. s1 = "hello";
  12. System.out.println("s1 = " + s1); // s1 = hello
  13. System.out.println("s2 = " + s2); // s2 = 123
  14. }
  15. }


该分类下的相关小册推荐: