Test of the Java Skill(2)

麟麟enjoy

麟麟enjoy

2016-02-19 18:40

今天图老师小编给大家精心推荐个Test of the Java Skill(2)教程,一起来看看过程究竟如何进行吧!喜欢还请点个赞哦~


     Question 9:
     What code placed after the comment:
       // Start For loop
     would populate the elements of the array ia[] with values of the variables i ?
  
     public class Lin{
     public static void main(String argv[]){
     Lin l = new Lin();
     l.amethod();
     }
  
     public void amethod(){
     int ia[] = new int[4];
     // Start For loop
     {
     ia[i] = i;
     System.out.println(ia[i]);
     }
     }
     }
  
     A. for(int i=0; i
  
     B. for (int i=0; i
  
     C. for(int i=0; i4; i++)
  
     D. for(int i=0; i
  
     Question 10:
     Consider the following code:
     Integer s = new Integer(9);
     Integer t = new Integer(9);
     Long u = new Long(9);
     Which test would return true?
    A. (s==u)
  
     B. (s==t)
  
     C. (s.equals(t))
  
     D. (s.equals(9))
  
     E. (s.equals(new Integer(9))
  
     Question 11:
     Which of the following is sUCcessfully create an instance of the Vector class and add an element?
  
     A. Vector v = new Vector(99);
     v[1]=99;
  
     B. Vector v = new Vector();
     v.addElement(99);
  
     C. Vector v = new Vector();
     v.add(99);
  
     D. Vector v = new Vector(100);
     v.addElement(“99”);
  
     Question 12:
     What will happen when you attempt to compile and run the following code?
  
     class Base{
     private void amethod(int iBase){
     System.out.println(“Base.amethod”);
     }
     }

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

   class Over extends Base{
     public static void main(String argv[]){
     Over o = new Over();
     int iBase=0;
     o.amethod(iBase);
     }
  
     public void amethod(int iOver){
     System.out.println(“Over.amethod”);
     }
     }
  
     A. Compile time error complaining that Base.amethod is private
  
     B. Runtime error complaining that Base.amethod is private
  
     C. Output of Base.amethod
  
     D. Output of Over.amethod
  
     Question 13:
     What will happen if you try to compile and run the following code?
  
     public class MyClass
     public static void main(String arguments[]){
     amethod(arguments);
     }
  
     public void amethod(String[] arguments)
     System.out.println(arguments);
     System.out.println(arguments[1]);
     }
     }
  
     A. Error can't make static reference to void amethod
  

展开更多 50%)
分享

猜你喜欢

Test of the Java Skill(2)

编程语言 网络编程
Test of the Java Skill(2)

Test of the Java Skill(1)

编程语言 网络编程
Test of the Java Skill(1)

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

Test of the Java Skill(4)

编程语言 网络编程
Test of the Java Skill(4)

java_util_test

编程语言 网络编程
java_util_test

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

正则匹配的test函数

Web开发
正则匹配的test函数

Java2 RMI 入门

编程语言 网络编程
Java2 RMI 入门

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

网站优化需要重要注意的几点事项

网站优化需要重要注意的几点事项

Windows7系统下有线网络优先级设置

Windows7系统下有线网络优先级设置
下拉加载更多内容 ↓