zoukankan      html  css  js  c++  java
  • 20145109 《Java程序设计》第八周学习总结

    Chapter 15 API

    java.util.logging package

    The constructor of Logger class is protected. If Logger instance is needed, must use static function getLogger().

    e.g.

    Logger logger = Logger.gerLogger("cc.openhome.Main");
    
    //Logger logger = Logger.gerLogger(Main.class.getName());
    //If you add '.class' you can get the class instance, then '.getName' can get the full name
    

    ResourceBundle

    for changeable information, it is considerable to move it out of program.

    .properties must be put in classpath.

    Locale

    It contains two points: Language code & Country code.

    Language code:

    ca: Catalan
    zh: Chinese
    

    Country code:

    IT: Italy
    TW: Taiwan
    CN: China
    

    Regular Expression

    Character class:

    [ ] means if any:

        for (String token : "Justin1Monica2Irene3".split("[123]")) {
            out.println(token);
        }
    
    • means from to:

      [1-5], [a-z]

    ^ means without:

    [^abc]
    

    Greedy quantifier, Reluctant quantifier

    Greedy quantifier will find the suitable words as longer as possible.

    d{4}-d{6} equals dddd-dddddd
    xfooxxxxxxxfo if compared by .*foo, it 's the full

    Reluctant quantifier will find the suitable words as shorter as possible.

    xfooxxxxxxxfo if compared by .*?foo, there will be two: xfoo and xxxxxxxfo

    Possessive quantifier will eat all suitable words and won't back-up

    xfooxxxxxxxfo if compared by .?+foo, there's none left, because .+ is suitable for xfooxxxxxxxfo, so nothing left.

  • 相关阅读:
    智能指针unique_ptr记录
    ubuntu系统火狐无法播放网页视频
    javascript中json对象json数组json字符串互转及取值
    C#压缩文件
    C#异步编程
    C# POST请求 json格式
    C# Http方式下载文件到本地类
    C#中NPOI操作excel之读取和写入excel数据
    浅析C#中抽象类和接口的区别
    C#自动实现Dll(OCX)控件注册的两种方法
  • 原文地址:https://www.cnblogs.com/Christen/p/5428674.html
Copyright © 2011-2022 走看看