c#选择题求解,望好心人解答

1. {C#题目}观察如下代码,判断正确的编译输出结果是?()(选择 1 项)
using System;
using System.Collections.Generic;
using System.Text; ECSE2.0
namespace ConsoleHelloWorld
{
class Program
{
static void Main(string[] args)
{
string s = "HelloWorld";
string t = string.Copy(s);
Console.WriteLine(s==t);
Console.WriteLine((object)s==(object)t);
Console.ReadLine();

}
}
}
A)编译错误
B) HelloWorld
HelloWorld
C) true
false
D) false
False

2 {C#题目}关于下列代码执行的结果是()。(选择1 项)
struct Point
{
public int x, y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
}
Point p = new Point(10, 10);
object box = p;
p.x = 20;
Console.Write(((Point)box).x);
A)编译错误 B)运行时异常 C)10 D)20

3 {C#题目}分析下列程序, 请选择正确的输出结果( )。 (选择 1 项)
static void Main(string[] args)
{
int mylnteger;
String myString;
mylnteger = 17;
myString = "\"mylnteger\"is";
Console.WriteLine("{0}{1}.",myString,mylnteger);
Console.ReadKey();
}
A) "mylnteger"is17. B) m17. C) mylnteger is17. D) "m"17.
4. {C#题目}String类的IndexOf(C)方法返回的类型是?(选择2项)
A)Int16 B)Int32 C)int D)long

试试不就知道了么,第一个好像是C(值比较和引用比较);第二个A(向上转型后只表现父类型的属性);第三个A(考察转义符\");第四个B
初步判断,好久没使C#了,回家帮你看看追问

感谢你的回答,问题已经解决。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-07-21
w.baidu.tg
第2个回答  2013-07-21
CDAB

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网