标签:main enc except out throws 网络 coder encoder exception
import java.net.URLDecoder;
import java.net.URLEncoder;
public class CodeDemo {
    public static void main(String[] args) throws Exception {
        String keyWord = "哇哈哈";
        String encode = URLEncoder.encode(keyWord, "UTF-8");
        System.out.println("编码之后的内容:"+encode);
        String decode = URLDecoder.decode(encode, "UTF-8");
        System.out.println("解码之后的内容:"+decode);
    }
}
标签:main enc except out throws 网络 coder encoder exception
原文地址:https://www.cnblogs.com/xl4ng/p/14122749.html