1. 程式人生 > >筆試題目積累

筆試題目積累

utf8 amp [] per exc nic gbk cnblogs class

1:接口可以被哪一些修飾符修飾?

答案:interface only public & abstract are permitted、

2:輸出下面的答案!

public class StringLength {

    public static void main(String[] args) throws Exception {
        String str = "我是大鑫";
        System.out.println(str.length());//4
        System.out.println(str.getBytes("utf8").length);//
12 System.out.println(str.getBytes("gbk").length);//8 System.out.println(str.getBytes("unicode").length);//10 } }

筆試題目積累