二.
1. 填空:
(1)面向对象的语言具有________性、_________性、________性。
(2)能用foreach遍历访问的对象需要实现________________接口或声明________________方法的类型。
(3)中的五个主要对象_______________、_____________、_______________、_______________、_________________。
2. 不定项选择:
(1) 以下叙述正确的是:
A. 接口中可以有虚方法。 B. 一个类可以实现多个接口。
C. 接口不能被实例化。 D. 接口中可以包含已实现的方法。
(2) 从数据库读取记录,你可能用到的方法有:
A. ExecuteNonQuery B. ExecuteScalar
C. Fill D. ExecuteReader
3. 简述 private、 protected、 public、 internal 修饰符的访问权限。
4. 写出一条Sql语句: 取出表A中第31到第40记录(SQLServer, 以自动增长的ID作为主键, 注意:ID可能不是连续的。)
5 . 页面之间传递值的几种方式。
6. 写出程序的输出结果
class Class1 {
private string str = "";
private int i = 0;
static void StringConvert(string str) {
str = "string being converted.";
}
static void StringConvert(Class1 c) {
= "string being converted.";
}
static void Add(int i) {
i++;
}
static void AddWithRef(ref int i) {
i++;
}
static void Main() {
int i1 = 10;
int i2 = 20;
string str = "str";
Class1 c = new Class1();
Add(i1);
AddWithRef(ref i2);
Add();
StringConvert(str);
StringConvert(c);
(i1);
(i2);
();
(str);
();
}
}
7.
写出程序的输出结果
public abstract class A
{
public A()
{
('A');
}
public virtual void Fun()
{
("()");
}
}
public class B: A
{
public B()
{
('B');
}
public new void Fun()
{
笔试题 来自淘豆网m.daumloan.com转载请标明出处.