当前位置: 技术问答>linux和unix
linux 下 c# 和 ms c#的比较
来源: 互联网 发布时间:2014-12-16
本文导语: mono 公司 c#下载 http://www.go-mono.com/download.html 有win32版的,有linux版的,我比较了一下,mono公司还是做得比较好的, 但有中文问题,和java一样会让人比较头疼的。 下边代码 ————————————————...
mono 公司 c#下载 http://www.go-mono.com/download.html
有win32版的,有linux版的,我比较了一下,mono公司还是做得比较好的,
但有中文问题,和java一样会让人比较头疼的。
下边代码 ————————————————————ms c# 的运行没问题。
using System;
class Person
{
private string myName ="N/A";
private int myAge = 0;
// 声明一个字符型的属性Name
public string Name
{
get
{
return myName;
}
set
{
myName = value;
}
}
// 声明一个int型的Age属性
public int Age
{
get
{
return myAge;
}
set
{
myAge = value;
}
}
public override string ToString()
{
return "Name = " + Name + ", Age = " + Age;
}
public static void Main()
{
string name = "";
name = Console.ReadLine();
Console.WriteLine("Simple Properties");
Person person = new Person();
Console.WriteLine("Person details - {0}", person);
person.Name = name;
person.Age = 99;
Console.WriteLine("Person details - {0}", person);
person.Name = "趁远";
person.Age += 1;
Console.WriteLine("Person details - {0}", person);
Console.Read();
}
}
输出 ——————————————————
远的
Simple Properties
Person details - Name = N/A, Age = 0
Person details - Name = 远的, Age = 99
Person details - Name = ?, Age = 100
——————————————————————————————————
TNND 趁远 变成问号了。
不过linux下又多了一门语言,加上新出的Kylix3,感觉linux有希望多了。
有win32版的,有linux版的,我比较了一下,mono公司还是做得比较好的,
但有中文问题,和java一样会让人比较头疼的。
下边代码 ————————————————————ms c# 的运行没问题。
using System;
class Person
{
private string myName ="N/A";
private int myAge = 0;
// 声明一个字符型的属性Name
public string Name
{
get
{
return myName;
}
set
{
myName = value;
}
}
// 声明一个int型的Age属性
public int Age
{
get
{
return myAge;
}
set
{
myAge = value;
}
}
public override string ToString()
{
return "Name = " + Name + ", Age = " + Age;
}
public static void Main()
{
string name = "";
name = Console.ReadLine();
Console.WriteLine("Simple Properties");
Person person = new Person();
Console.WriteLine("Person details - {0}", person);
person.Name = name;
person.Age = 99;
Console.WriteLine("Person details - {0}", person);
person.Name = "趁远";
person.Age += 1;
Console.WriteLine("Person details - {0}", person);
Console.Read();
}
}
输出 ——————————————————
远的
Simple Properties
Person details - Name = N/A, Age = 0
Person details - Name = 远的, Age = 99
Person details - Name = ?, Age = 100
——————————————————————————————————
TNND 趁远 变成问号了。
不过linux下又多了一门语言,加上新出的Kylix3,感觉linux有希望多了。
|
还以为c#只是 M$$ 的玩意呢. .net 还是太新, 我还是让你们高手作先锋.
Kylix3 同时支持 Delphi 和 C++, 据Borland方面说, Kylix的编译器是世上
数一数二的快, 每分钟可编译4,000,000行!! 看来Borland真的带给linux
另类选择.
Kylix3 同时支持 Delphi 和 C++, 据Borland方面说, Kylix的编译器是世上
数一数二的快, 每分钟可编译4,000,000行!! 看来Borland真的带给linux
另类选择.
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。