2024年4月21日发(作者:)
.NET笔试题
默认分类 2008-03-13 21:24:06 阅读1336 评论1 字号:大中小
编辑 删除
.NET笔试题
分类:C#&
姓名: 日期:
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(c.i);
StringConvert(str);
StringConvert(c);
ine(i1);
ine(i2);
ine(c.i);
ine(str);
ine();
}
}
7.写出程序的输出结果
public abstract class A
{
public A()
{
发布者:admin,转转请注明出处:http://www.yc00.com/news/1713649513a2291008.html
评论列表(0条)