码迷,mamicode.com
首页 > 其他好文 > 详细

笔试题目积累

时间:2017-09-11 22:48:03      阅读:91      评论:0      收藏:0      [点我收藏+]

标签:rmi   bytes   cep   exce   interface   public   length   logs   print   

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

    }

}

 

笔试题目积累

标签:rmi   bytes   cep   exce   interface   public   length   logs   print   

原文地址:http://www.cnblogs.com/leodaxin/p/7507233.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!