狠狠撸

狠狠撸Share a Scribd company logo
1.    是否题
1.    所谓缺省构造函数就是不带参数的构造函数
2.    java 的 char 类型是八位的
3.    一个 java 类可有多个父类,称为多继承
4.    对象成员变量在对象创建时会获得一个缺省的初始值
5.    java 数组可随时改变大小
6.    InputStream 和 OutputStream 读写的数据是八位的
7.    java 是强类型的
8.    java 没有指针,引用不能等同于指针
9.    protected 的成员只能被类继承成员存取
10.   任何 Applet 都不可以访问本地资源

2.    选择题
1.    下面对于 java 引用说法正确的有
 a.    引用实际上就是指针
 b.    引用本身是 primitive
 c.   引用就是对象本身
 d.   一个对象只能被一个引用所指引

2. 在一个线程中使用 sleep(1000)方法,将使该线程在多少时间后或得 CPU 控制,(假设睡眠
   过程中不会有其他事件唤醒该线程)
 a. 正好 1000 豪秒
 b. 1000 毫秒不到
 c. >=1000ms
 d. 不一定,可能>1000ms 可能<1000ms

3. 对于 import java.util.Vector 以下说法是错误的
   a. Vector 属于 java.util 包
   b. Vector 放在../java/util 目录下
   c. Vector 放在 java.util 文件类
   d. Vector 是 sun 公司的产物

4. 以下对于垃圾收集的说法是正确的
   a. 一旦一个对象成为垃圾,立即被回收掉
   b. 对象空间被收集掉之后,会调用该对象的 finalize()方法
   c. Finalize()和 C++的析够函数是一回事
   d. 一个对象成为垃圾是因为不再有引用指向它,但是线程并非如此

5. 对于异常说法正确的是
a 一旦程序出现异常,程序就终止了
b.如果一个方法申明将会抛出异常,它就必须真的抛出异常
c.在 catch 子句中匹配异常是一中精确匹配
d.可能抛出系统异常的方法是不需要申明异常的
3. 小问题
A .final
finally
finalize

B.一个类可继承几个超类?一个类可实现几个接口?一个接口可继承几个接口 ?一个接口可继
承类吗?接口可实现接口吗?

四假设已编写好了 Class1
package testpackage;
public class Class1
{

}
Class1.java

MainPro.java
Import testpackage;
……
Classpath=.;c:javalibclasses.zip
MainPro c:testdir
当前工作目录是 testdir.
Class1 应放在哪个目录

6. 指出下列程序错误

    Class Value
    {
     Int i=1 ;
    }

    Public class FinalData
    {
     Final int i1=9 ;
    Static int i2 =99;
    Public static final int i3=49;
    Final int i4=(int)(Math.Random()*20);
    Static final int i5=(int)(Math.random()*20);
    Value v1 = new Value();
    Final Value v2 = new Value();
    Static final Value v3= new Value();
    Final Value v4;
    Final int []a ={2,4,5};
Public static void main(String args[])
{
 FinalData fd1 = new FinalData();
 Fd1.i1++;
 Fd1.v2.i++;
 Fd1.value=new Value();
 For(int i=0;i<fd1.a.length;i++)
   Fd1.a[i]++;

Fd1.v2=new Value();
Fd1.v3=new Value();



}




五,写出运行结果

Class Letter
{
  Char c;
}

Public class PassObject
{
 Static void f(Letter y)
  {
   y.c = ‘z’;
  }

Public static void main(String args[])
 {
  Letter x= new Letter();
  x.c=’a’;
   f(x);
 System.out.println(x);
  }
}



写出运行结果
Class Annoyance extends Exception {}
Class Snzze extends Annoyance{}

Public class Human
{
  Public static void main(String args[])
  {
     Try
       {
         Throw new Snzze();
       }catch(Snzze s)
     {
       System.out.println(“snzze”);
     }catch(Annoyance a)
      {
        System.out..println(“annoyance”);



        }

    }

}




七.java 与 C++的不同

More Related Content

What's hot (18)

2, object oriented programming
2, object oriented programming2, object oriented programming
2, object oriented programming
ted-xu
?
厂肠补濒补再探
厂肠补濒补再探厂肠补濒补再探
厂肠补濒补再探
afeihehe
?
C python 原始碼解析 投影片
C python 原始碼解析 投影片C python 原始碼解析 投影片
C python 原始碼解析 投影片
kao kuo-tung
?
函数调用关系工具-2011-孙光福
函数调用关系工具-2011-孙光福函数调用关系工具-2011-孙光福
函数调用关系工具-2011-孙光福
Wu Liang
?
型态与运算子
型态与运算子型态与运算子
型态与运算子
Justin Lin
?
Python程式設計 - 分支作業
Python程式設計 - 分支作業Python程式設計 - 分支作業
Python程式設計 - 分支作業
吳錫修 (ShyiShiou Wu)
?
Introduction to Basic Haskell Components (In Chinese)
Introduction to Basic Haskell Components (In Chinese)Introduction to Basic Haskell Components (In Chinese)
Introduction to Basic Haskell Components (In Chinese)
ChengHui Weng
?
Scala function-and-closures
Scala function-and-closuresScala function-and-closures
Scala function-and-closures
wang hongjiang
?
Intro to C++ Basic
Intro to C++ BasicIntro to C++ Basic
Intro to C++ Basic
Shih Chi Lin
?
Programming in Objective-C
Programming in Objective-CProgramming in Objective-C
Programming in Objective-C
Ryan Chung
?
functional-scala
functional-scalafunctional-scala
functional-scala
wang hongjiang
?
笔测迟丑辞苍基本资料运算
笔测迟丑辞苍基本资料运算笔测迟丑辞苍基本资料运算
笔测迟丑辞苍基本资料运算
吳錫修 (ShyiShiou Wu)
?
lambda/closure – JavaScript、Python、Scala 到 Java SE 7
lambda/closure – JavaScript、Python、Scala 到 Java SE 7lambda/closure – JavaScript、Python、Scala 到 Java SE 7
lambda/closure – JavaScript、Python、Scala 到 Java SE 7
Justin Lin
?
箩蚕耻别谤测源码学习
箩蚕耻别谤测源码学习箩蚕耻别谤测源码学习
箩蚕耻别谤测源码学习
fangdeng
?
Python 迴圈作業
Python 迴圈作業Python 迴圈作業
Python 迴圈作業
吳錫修 (ShyiShiou Wu)
?
颁濒辞箩耻谤别介绍与应用
颁濒辞箩耻谤别介绍与应用颁濒辞箩耻谤别介绍与应用
颁濒辞箩耻谤别介绍与应用
Robert Hao
?
2, object oriented programming
2, object oriented programming2, object oriented programming
2, object oriented programming
ted-xu
?
厂肠补濒补再探
厂肠补濒补再探厂肠补濒补再探
厂肠补濒补再探
afeihehe
?
C python 原始碼解析 投影片
C python 原始碼解析 投影片C python 原始碼解析 投影片
C python 原始碼解析 投影片
kao kuo-tung
?
函数调用关系工具-2011-孙光福
函数调用关系工具-2011-孙光福函数调用关系工具-2011-孙光福
函数调用关系工具-2011-孙光福
Wu Liang
?
型态与运算子
型态与运算子型态与运算子
型态与运算子
Justin Lin
?
Introduction to Basic Haskell Components (In Chinese)
Introduction to Basic Haskell Components (In Chinese)Introduction to Basic Haskell Components (In Chinese)
Introduction to Basic Haskell Components (In Chinese)
ChengHui Weng
?
Scala function-and-closures
Scala function-and-closuresScala function-and-closures
Scala function-and-closures
wang hongjiang
?
Programming in Objective-C
Programming in Objective-CProgramming in Objective-C
Programming in Objective-C
Ryan Chung
?
lambda/closure – JavaScript、Python、Scala 到 Java SE 7
lambda/closure – JavaScript、Python、Scala 到 Java SE 7lambda/closure – JavaScript、Python、Scala 到 Java SE 7
lambda/closure – JavaScript、Python、Scala 到 Java SE 7
Justin Lin
?
箩蚕耻别谤测源码学习
箩蚕耻别谤测源码学习箩蚕耻别谤测源码学习
箩蚕耻别谤测源码学习
fangdeng
?
颁濒辞箩耻谤别介绍与应用
颁濒辞箩耻谤别介绍与应用颁濒辞箩耻谤别介绍与应用
颁濒辞箩耻谤别介绍与应用
Robert Hao
?

Viewers also liked (10)

S H U N S U I C I D E L I V E H A P P I L Y Dr
S H U N  S U I C I D E   L I V E  H A P P I L Y  DrS H U N  S U I C I D E   L I V E  H A P P I L Y  Dr
S H U N S U I C I D E L I V E H A P P I L Y Dr
ghanyog
?
C++ arabic course
C++ arabic courseC++ arabic course
C++ arabic course
Bazil Al-oran
?
Villa Carioca Klabin Segall E Mail
Villa Carioca   Klabin Segall   E MailVilla Carioca   Klabin Segall   E Mail
Villa Carioca Klabin Segall E Mail
imoveisdorio
?
ELC VM PRESENTATION_052906_
ELC VM PRESENTATION_052906_ELC VM PRESENTATION_052906_
ELC VM PRESENTATION_052906_
Domingo Valdez
?
Translation: Buying a non-commodity
Translation: Buying a non-commodityTranslation: Buying a non-commodity
Translation: Buying a non-commodity
SFM Traduction
?
Mate.2
Mate.2Mate.2
Mate.2
Dave Malouf
?
HabilidadesHabilidades
Habilidades
rocio cardozo
?
Gokyuzu Yeryuzu
Gokyuzu YeryuzuGokyuzu Yeryuzu
Gokyuzu Yeryuzu
atmaca77
?
Progetto G3
Progetto G3Progetto G3
Progetto G3
Marco Gafforini
?
M U S I C A N D S U P E R H E A L T H D R
M U S I C  A N D  S U P E R H E A L T H  D RM U S I C  A N D  S U P E R H E A L T H  D R
M U S I C A N D S U P E R H E A L T H D R
ghanyog
?
S H U N S U I C I D E L I V E H A P P I L Y Dr
S H U N  S U I C I D E   L I V E  H A P P I L Y  DrS H U N  S U I C I D E   L I V E  H A P P I L Y  Dr
S H U N S U I C I D E L I V E H A P P I L Y Dr
ghanyog
?
Villa Carioca Klabin Segall E Mail
Villa Carioca   Klabin Segall   E MailVilla Carioca   Klabin Segall   E Mail
Villa Carioca Klabin Segall E Mail
imoveisdorio
?
ELC VM PRESENTATION_052906_
ELC VM PRESENTATION_052906_ELC VM PRESENTATION_052906_
ELC VM PRESENTATION_052906_
Domingo Valdez
?
Translation: Buying a non-commodity
Translation: Buying a non-commodityTranslation: Buying a non-commodity
Translation: Buying a non-commodity
SFM Traduction
?
HabilidadesHabilidades
Habilidades
rocio cardozo
?
Gokyuzu Yeryuzu
Gokyuzu YeryuzuGokyuzu Yeryuzu
Gokyuzu Yeryuzu
atmaca77
?
M U S I C A N D S U P E R H E A L T H D R
M U S I C  A N D  S U P E R H E A L T H  D RM U S I C  A N D  S U P E R H E A L T H  D R
M U S I C A N D S U P E R H E A L T H D R
ghanyog
?

Similar to 闯补惫补考试试题 (13)

Java memory model
Java memory modelJava memory model
Java memory model
Shawn Wang
?
Java SE 7 技術手冊 - 課後練習解答
Java SE 7 技術手冊 - 課後練習解答Java SE 7 技術手冊 - 課後練習解答
Java SE 7 技術手冊 - 課後練習解答
Justin Lin
?
Keep your code clean
Keep your code cleanKeep your code clean
Keep your code clean
macrochen
?
闯蝉的国(转载)
闯蝉的国(转载)闯蝉的国(转载)
闯蝉的国(转载)
Leo Hui
?
Javascript oop-o52tiger
Javascript oop-o52tigerJavascript oop-o52tiger
Javascript oop-o52tiger
o52tiger
?
JCConf 2024 - Java 22 & 23 新功能介紹
JCConf 2024 - Java 22 & 23 新功能介紹 JCConf 2024 - Java 22 & 23 新功能介紹
JCConf 2024 - Java 22 & 23 新功能介紹
Joseph Kuo
?
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
炎炎夏日學 Android 課程 -  Part1: Kotlin 語法介紹炎炎夏日學 Android 課程 -  Part1: Kotlin 語法介紹
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
Johnny Sung
?
Lucene2 4学习笔记1
Lucene2 4学习笔记1Lucene2 4学习笔记1
Lucene2 4学习笔记1
yiditushe
?
Arduino應用系統設計 - Arduino程式快速入門
Arduino應用系統設計 - Arduino程式快速入門Arduino應用系統設計 - Arduino程式快速入門
Arduino應用系統設計 - Arduino程式快速入門
吳錫修 (ShyiShiou Wu)
?
闯补惫补物件导向
闯补惫补物件导向闯补惫补物件导向
闯补惫补物件导向
艾鍗科技
?
12, string
12, string12, string
12, string
ted-xu
?
Java memory model
Java memory modelJava memory model
Java memory model
Shawn Wang
?
Java SE 7 技術手冊 - 課後練習解答
Java SE 7 技術手冊 - 課後練習解答Java SE 7 技術手冊 - 課後練習解答
Java SE 7 技術手冊 - 課後練習解答
Justin Lin
?
Keep your code clean
Keep your code cleanKeep your code clean
Keep your code clean
macrochen
?
闯蝉的国(转载)
闯蝉的国(转载)闯蝉的国(转载)
闯蝉的国(转载)
Leo Hui
?
Javascript oop-o52tiger
Javascript oop-o52tigerJavascript oop-o52tiger
Javascript oop-o52tiger
o52tiger
?
JCConf 2024 - Java 22 & 23 新功能介紹
JCConf 2024 - Java 22 & 23 新功能介紹 JCConf 2024 - Java 22 & 23 新功能介紹
JCConf 2024 - Java 22 & 23 新功能介紹
Joseph Kuo
?
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
炎炎夏日學 Android 課程 -  Part1: Kotlin 語法介紹炎炎夏日學 Android 課程 -  Part1: Kotlin 語法介紹
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
Johnny Sung
?
Lucene2 4学习笔记1
Lucene2 4学习笔记1Lucene2 4学习笔记1
Lucene2 4学习笔记1
yiditushe
?
Arduino應用系統設計 - Arduino程式快速入門
Arduino應用系統設計 - Arduino程式快速入門Arduino應用系統設計 - Arduino程式快速入門
Arduino應用系統設計 - Arduino程式快速入門
吳錫修 (ShyiShiou Wu)
?
闯补惫补物件导向
闯补惫补物件导向闯补惫补物件导向
闯补惫补物件导向
艾鍗科技
?
12, string
12, string12, string
12, string
ted-xu
?

More from yiditushe (20)

厂辫谤颈苍驳入门纲要
厂辫谤颈苍驳入门纲要厂辫谤颈苍驳入门纲要
厂辫谤颈苍驳入门纲要
yiditushe
?
J Bpm4 1中文用户手册
J Bpm4 1中文用户手册J Bpm4 1中文用户手册
J Bpm4 1中文用户手册
yiditushe
?
性能测试实践2
性能测试实践2性能测试实践2
性能测试实践2
yiditushe
?
性能测试实践1
性能测试实践1性能测试实践1
性能测试实践1
yiditushe
?
性能测试技术
性能测试技术性能测试技术
性能测试技术
yiditushe
?
Load runner测试技术
Load runner测试技术Load runner测试技术
Load runner测试技术
yiditushe
?
J2 ee性能测试
J2 ee性能测试J2 ee性能测试
J2 ee性能测试
yiditushe
?
面向对象的闯蝉培训
面向对象的闯蝉培训面向对象的闯蝉培训
面向对象的闯蝉培训
yiditushe
?
贵濒别虫3中文教程
贵濒别虫3中文教程贵濒别虫3中文教程
贵濒别虫3中文教程
yiditushe
?
开放源代码的全文检索尝耻肠别苍别
开放源代码的全文检索尝耻肠别苍别开放源代码的全文检索尝耻肠别苍别
开放源代码的全文检索尝耻肠别苍别
yiditushe
?
基于分词索引的全文检索技术介绍
基于分词索引的全文检索技术介绍基于分词索引的全文检索技术介绍
基于分词索引的全文检索技术介绍
yiditushe
?
Lucene In Action
Lucene In ActionLucene In Action
Lucene In Action
yiditushe
?
Lucene 全文检索实践
Lucene 全文检索实践Lucene 全文检索实践
Lucene 全文检索实践
yiditushe
?
Lucene 3[1] 0 原理与代码分析
Lucene 3[1] 0 原理与代码分析Lucene 3[1] 0 原理与代码分析
Lucene 3[1] 0 原理与代码分析
yiditushe
?
7 面向对象设计原则
7 面向对象设计原则7 面向对象设计原则
7 面向对象设计原则
yiditushe
?
10 团队开发
10  团队开发10  团队开发
10 团队开发
yiditushe
?
9 对象持久化与数据建模
9  对象持久化与数据建模9  对象持久化与数据建模
9 对象持久化与数据建模
yiditushe
?
8 Uml构架建模
8  Uml构架建模8  Uml构架建模
8 Uml构架建模
yiditushe
?
厂辫谤颈苍驳入门纲要
厂辫谤颈苍驳入门纲要厂辫谤颈苍驳入门纲要
厂辫谤颈苍驳入门纲要
yiditushe
?
J Bpm4 1中文用户手册
J Bpm4 1中文用户手册J Bpm4 1中文用户手册
J Bpm4 1中文用户手册
yiditushe
?
性能测试实践2
性能测试实践2性能测试实践2
性能测试实践2
yiditushe
?
性能测试实践1
性能测试实践1性能测试实践1
性能测试实践1
yiditushe
?
性能测试技术
性能测试技术性能测试技术
性能测试技术
yiditushe
?
Load runner测试技术
Load runner测试技术Load runner测试技术
Load runner测试技术
yiditushe
?
J2 ee性能测试
J2 ee性能测试J2 ee性能测试
J2 ee性能测试
yiditushe
?
面向对象的闯蝉培训
面向对象的闯蝉培训面向对象的闯蝉培训
面向对象的闯蝉培训
yiditushe
?
贵濒别虫3中文教程
贵濒别虫3中文教程贵濒别虫3中文教程
贵濒别虫3中文教程
yiditushe
?
开放源代码的全文检索尝耻肠别苍别
开放源代码的全文检索尝耻肠别苍别开放源代码的全文检索尝耻肠别苍别
开放源代码的全文检索尝耻肠别苍别
yiditushe
?
基于分词索引的全文检索技术介绍
基于分词索引的全文检索技术介绍基于分词索引的全文检索技术介绍
基于分词索引的全文检索技术介绍
yiditushe
?
Lucene In Action
Lucene In ActionLucene In Action
Lucene In Action
yiditushe
?
Lucene 全文检索实践
Lucene 全文检索实践Lucene 全文检索实践
Lucene 全文检索实践
yiditushe
?
Lucene 3[1] 0 原理与代码分析
Lucene 3[1] 0 原理与代码分析Lucene 3[1] 0 原理与代码分析
Lucene 3[1] 0 原理与代码分析
yiditushe
?
7 面向对象设计原则
7 面向对象设计原则7 面向对象设计原则
7 面向对象设计原则
yiditushe
?
10 团队开发
10  团队开发10  团队开发
10 团队开发
yiditushe
?
9 对象持久化与数据建模
9  对象持久化与数据建模9  对象持久化与数据建模
9 对象持久化与数据建模
yiditushe
?
8 Uml构架建模
8  Uml构架建模8  Uml构架建模
8 Uml构架建模
yiditushe
?

闯补惫补考试试题

  • 1. 1. 是否题 1. 所谓缺省构造函数就是不带参数的构造函数 2. java 的 char 类型是八位的 3. 一个 java 类可有多个父类,称为多继承 4. 对象成员变量在对象创建时会获得一个缺省的初始值 5. java 数组可随时改变大小 6. InputStream 和 OutputStream 读写的数据是八位的 7. java 是强类型的 8. java 没有指针,引用不能等同于指针 9. protected 的成员只能被类继承成员存取 10. 任何 Applet 都不可以访问本地资源 2. 选择题 1. 下面对于 java 引用说法正确的有 a. 引用实际上就是指针 b. 引用本身是 primitive c. 引用就是对象本身 d. 一个对象只能被一个引用所指引 2. 在一个线程中使用 sleep(1000)方法,将使该线程在多少时间后或得 CPU 控制,(假设睡眠 过程中不会有其他事件唤醒该线程) a. 正好 1000 豪秒 b. 1000 毫秒不到 c. >=1000ms d. 不一定,可能>1000ms 可能<1000ms 3. 对于 import java.util.Vector 以下说法是错误的 a. Vector 属于 java.util 包 b. Vector 放在../java/util 目录下 c. Vector 放在 java.util 文件类 d. Vector 是 sun 公司的产物 4. 以下对于垃圾收集的说法是正确的 a. 一旦一个对象成为垃圾,立即被回收掉 b. 对象空间被收集掉之后,会调用该对象的 finalize()方法 c. Finalize()和 C++的析够函数是一回事 d. 一个对象成为垃圾是因为不再有引用指向它,但是线程并非如此 5. 对于异常说法正确的是 a 一旦程序出现异常,程序就终止了 b.如果一个方法申明将会抛出异常,它就必须真的抛出异常 c.在 catch 子句中匹配异常是一中精确匹配 d.可能抛出系统异常的方法是不需要申明异常的
  • 2. 3. 小问题 A .final finally finalize B.一个类可继承几个超类?一个类可实现几个接口?一个接口可继承几个接口 ?一个接口可继 承类吗?接口可实现接口吗? 四假设已编写好了 Class1 package testpackage; public class Class1 { } Class1.java MainPro.java Import testpackage; …… Classpath=.;c:javalibclasses.zip MainPro c:testdir 当前工作目录是 testdir. Class1 应放在哪个目录 6. 指出下列程序错误 Class Value { Int i=1 ; } Public class FinalData { Final int i1=9 ; Static int i2 =99; Public static final int i3=49; Final int i4=(int)(Math.Random()*20); Static final int i5=(int)(Math.random()*20); Value v1 = new Value(); Final Value v2 = new Value(); Static final Value v3= new Value(); Final Value v4; Final int []a ={2,4,5};
  • 3. Public static void main(String args[]) { FinalData fd1 = new FinalData(); Fd1.i1++; Fd1.v2.i++; Fd1.value=new Value(); For(int i=0;i<fd1.a.length;i++) Fd1.a[i]++; Fd1.v2=new Value(); Fd1.v3=new Value(); } 五,写出运行结果 Class Letter { Char c; } Public class PassObject { Static void f(Letter y) { y.c = ‘z’; } Public static void main(String args[]) { Letter x= new Letter(); x.c=’a’; f(x); System.out.println(x); } } 写出运行结果
  • 4. Class Annoyance extends Exception {} Class Snzze extends Annoyance{} Public class Human { Public static void main(String args[]) { Try { Throw new Snzze(); }catch(Snzze s) { System.out.println(“snzze”); }catch(Annoyance a) { System.out..println(“annoyance”); } } } 七.java 与 C++的不同