首页 > 其他 > 详细

笔试题目积累

时间:2017-09-11 21:58:31      阅读:268      评论:0      收藏:0      [点我收藏+]

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

    }

}

 

笔试题目积累

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!