几个有趣的面试题

2017-03-24  本文已影响338人  灰灰手记

搜集面试或工作中碰到的一些有趣好玩的问题,回头再做分析整理。
不定期更新。
我所说的有趣,不是说有多难,而是这里面一般都会有些坑,第一感觉往往会跳进去......


4、下面代码输出结果多少?

有两个App,分别是A和B,A能否将自己的布局(或者View)发送到B中去显示?


3、下面代码输出结果多少?
long num = 4*1024*1024*1024;
System.out.println(num);

2、下面button1:button2是多少?
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <Button
        android:id="@+id/button1"
        android:layout_width="match_parent"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:text="Button" />

    <Button
        android:id="@+id/button2"
        android:layout_width="match_parent"
        android:layout_weight="3"
        android:layout_height="wrap_content"
        android:text="Button" />
</LinearLayout>

1、下面这两行代码,编译运行结果是什么?
System.out.println(100%3);
System.out.println(100%3.0);

> 答案及分析过程 <

上一篇 下一篇

猜你喜欢

热点阅读