A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区


【Java基础】天啦噜,答题挣技术分啦!(一)


  还在为技术分犯愁吗?以后柳柳桑不定期给大家带来技术题,不仅可以考核一下所学的内容,还可以轻松获得技术分。好啦,不多说了,上题!(此处为Java基础专场,iOS学科的同学请绕行,不然答了也没分哦~



以下每题答对得一个技术分,共5个技术分。

1.下面程序执行的结果是?( )
boolean b=true;
if(b=false) //把值赋值给左边,留下左边。
{
      System.out.println("a");
}
else if(b)
{
      System.out.println(b);
}
else if(!b)
{
      System.out.println("c");
}
else
      System.out.println("d");
A.  a   
B.  true  
C.  c
D.  d

2. 阅读下面代码:
public class Test
{
  public static void main (String[ ] args)
  {
        char  ch=’c’;
        switch (ch)
        {
             case  ‘a’:
                      System.out.print(“a”);
break;
             case  ’b’:
System.out.print(“ab”);
             case  ’c’:
                      System.out.print(“c”);
             default:
System.out.print(“d”);
        }
  }
}
输出的结果为(  )
A.  a
B.  b
C.  c
D.  cd
3. 给出以下代码,请问该程序的运行结果是什么?
class Demo {
String s = "Outer";
public static void main(String[] args) {
S2s2 = new S2();
s2.display();
}
}
class S1 {
String s = "S1";
publicvoid display(){
System.out.println(s);
}
}
class S2 extends S1 {
Strings = "S2";
}
答案是什么?

4. 下面哪些语句可以通过编译(  )
A.  float a= 1.34f;  
B.  float b=1.0;
C.  float c=2f;
D.  float d=20;

5.   下面数组定义正确的是?()
A.  int arr[]= new int[3];
B.  int arr[] =new int[3]{1,2,3};
C.  int [][]x =new int[][];
D. int[][] x = new int[2][];



各位同学,请将答案直接以直接回帖的形式发布,答案仅楼主可见。

答题截止时间:2016年6月23日
加技术分时间:2016年6月24日
注意点:【Java基础】仅限Java学科的同学作答,非Java学科的同学答了也不加分!

请大家认真答题,另外请随时关注柳柳桑动态哦~技术答题活动不断,挣技术分轻松又简单,再也不用每日刷帖啦~


评分

参与人数 1技术分 +8 黑马币 +8 收起 理由
橘子哥 + 8 + 8 太帅啦!!

查看全部评分

125 个回复

倒序浏览
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
sgnx 中级黑马 2016-6-16 19:31:38
10#
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
此帖仅作者可见
使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马