笔试题

来源:互联网 发布:淘宝闲鱼app下载 编辑:程序博客网 时间:2024/06/14 15:57

1、在LinearLayout布局中,android:orientation 的默认值

 

2、读以下程序,find的值=

public staticfinal double [] RATIOS = new double[]{1.3333,1.5,1.6267,1.6667,1.7778};

double fullscreen= 1.6267;

double find = 4d/ 3;

for (int i=0; i< RATIOS.length ;i++) {

     if (Math.abs(RATIOS[i] - fullscreen) <Math.abs(fullscreen - find)) {

            find = RATIOS[i];

     }

}

 Return find;

 

3、举例说明ExplicitIntents(启动com.android.calendar) 和 Implicit Intents(打开www.baidu.com)。

Intent Exintent = new Intent(____________________________________);

startActivity(intent);

 

Intent Imintent = new Intent(____________________________________);

startActivity(intent);

 

4、用SharedPreferences 保存UserName=”zhangsan”,PassWord=”123456”

假设两个字段分别为

private static final String USERNAME;

private static final String PASSWORD;

   SharedPreferencessp = PreferenceManager.getDefaultSharedPreferences(getContext());

   SharedPreferences.Editoreditor = sp.edit();

  __________________________;

  __________________________;

  __________________________;

 

5、画一个简单的图说明满二叉树和完全二叉树。

 

 

 

 

6、什么是抽象类?抽象方法什么情况下使用?

0 0
原创粉丝点击