Discuss / Java / 练习

练习

Topic source
import java.io.UnsupportedEncodingException;
import java.util.logging.Logger;

public class Main {

    public static void main(String[] args) {
        Logger logger = Logger.getLogger(Main.class.getName());
        logger.info("Start process...");
        try {
            "".getBytes("asdfsadf");
        } catch (UnsupportedEncodingException e) {
            // TODO: 使用logger.severe()打印异常
            logger.severe("警告!无效字符集名称!");
        }

        logger.info("Process end.");
    }
}

  • 1

Reply