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#了,回家帮你看看追问
感谢你的回答,问题已经解决。