随笔分类 - 08 [面试题目总结]
[转载]:C# 中结构与类的区别
摘要:转载自:http://www.cftea.com/c/2008/03/JHB3MJM8DYGS0JJ9.asp完美集成、增强 KindEditor HTML 编辑器目录类与结构的实例比较类与结构的差别如何选择结构还是类类与结构的示例比较结构示例public struct Person{ string Name; int height; int weight public bool overWeight() { //implement something }}类示例public class TestTime{ int hours; int minutes; int seco...
阅读全文
面试题目小结
摘要:抽象类和接口的区别值类型和引用类型的区别soctdictionary and dictionary请你说说.NET中类和结构的区别?存储过程和函数的区别存储过程和触发器的区别session and cooike的区别linq limda
阅读全文
【修订版】C#/ASP.Net 面试题及答案(1)
摘要:这些题目都来源于网络,参考之前的答案,针对每道题做了简单的分析,恳请大家批评指正。 1. 简述 private、 protected、 public、 internal 修饰符的访问权限。答:本题考察 类的成员的可访问性。可访问性的关键字有如下5个:internal:在所属程序集中可以访问。private:私有成员, 在当前类中可以访问。 protected:保护成员,在当前类及其子类中可以访问。 public:公共成员,完全公开,没有访问限制。 internal protected:在所属程序集或当前类的子类中可以访问。(题目中未提及)【扩展】类的修饰符:abstract,sealed,s.
阅读全文
面试题: c#值类型和引用类型
摘要:c#值类型和引用类型在C#中,值类型:整型、布尔型、字符型、实数型、结构型、枚举型。引用类型:类、对象、字符串、数组、接口、委托。区别:1、值类型通常被分配在栈上,它的变量直接包含变量的实例,使用效率比较高。2、引用类型分配在托管堆上,引用类型的变量通常包含一个指向实例的指针,变量通过该指针来引用实例。3、值类型继承自ValueType(注意:而System.ValueType又继承自System.Object);而引用类型继承自System.Object。 4、值类型变量包含其实例数据,每个变量保存了其本身的数据拷贝(副本),因此在默认情况下,值类型的参数传递不会影响参数本身;而引用类型变.
阅读全文
接口和抽象类的区别
摘要:1. 面试题:接口和抽象类的区别 一、抽象类: 抽象类是特殊的类,只是不能被实例化;除此以外,具有类的其他特性;重要的是抽象类可以包括抽象方法,这是普通类所不能的。抽象方法只能声明于抽象类中,且不包含任何实现,派生类必须覆盖它们。另外,抽象类可以派生自一个抽象类,可以覆盖基类的抽象方法也可以不覆盖,如果不覆盖,则其派生类必须覆盖它们。二、接口: 接口是引用类型的,类似于类,和抽象类的相似之处有三点: 1、不能实例化; 2、包含未实现的方法声明; 3、派生类必须实现未实现的方法,抽象类是抽象方法,接口则是所有成员(不仅是方法包括其他成员); 另外,接口有如下特性:接口除了可以包含方法之外,还可.
阅读全文
【转载】:单例设计模式
摘要:http://www.dofactory.com/Patterns/PatternSingleton.aspxhttp://www.cnblogs.com/xun126/archive/2011/03/09/1970807.htmlC#设计模式学习笔记-单例模式 最近在学设计模式,学到创建型模式的时候,碰到单例模式(或叫单件模式),现在整理一下笔记。 在《Design Patterns:Elements of Resuable Object-Oriented Software》中的定义是:Ensurea class only has one instance,and provide a g..
阅读全文
[转载]:Shallow Copy and Deep Copy
摘要:Object.MemberwiseClone Method .protected Object MemberwiseClone()Return ValueType: System.ObjectA shallow copy of the current Object.Remarks The MemberwiseClone method creates a shallow copy by creati...
阅读全文
[原创]00:矩形算法题-二分法的扩展(2分法 * 2分法)
摘要:1.一个n*m的矩阵,求一个x是否在这个矩阵中的算法?矩形如下:1 3 5 8 102 4 6 11 123 5 9 12 156 8 10 13 18解析: 1):规律: 每行递增,每列递增, 2):利用二分法的扩展 a[n/2]每次去掉1/2, => a [n/2] [m/2]每次去掉 n/2* (m/2)划分为四个矩形,利用递归法进行分解。 3):如果 a [n/2] [m/2] ...
阅读全文
strstr()的简单实现
摘要:strstr()的简单实现strstr(s1,s2)是一个经常用的函数,他的作用就是在字符串s1中寻找字符串s2如果找到了就返回指针,否则返回NULL。下面是这个函数的一个简单实现:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->staticconstchar*_strstr(constchar*s1,constchar*s2){assert(s2&&s1);constchar*p=s1,*r=s2;while(*p!=
阅读全文
(34)-[转载] 程序员面试题精选100题 -找出数组中两个只出现一次的数字
摘要:题目:一个整型数组里除了两个数字之外,其他的数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n),空间复杂度是O(1)。分析:这是一道很新颖的关于位运算的面试题。首先我们考虑这个问题的一个简单版本:一个数组里除了一个数字之外,其他的数字都出现了两次。请写程序找出这个只出现一次的数字。这个题目的突破口在哪里?题目为什么要强调有一个数字出现一次,其他的出现两次?我们想到了异或...
阅读全文
[转] 深度理解依赖注入(Dependence Injection): Inversion of Control Containers and the Dependency Injection pattern
摘要:1):中文版:http://www.cnblogs.com/xingyukun/archive/2007/10/20/931331.html2) :Inversion of Control Containers and the Dependency Injection pattern http://www.martinfowler.com/articles/injection.html3):Ins...
阅读全文
[转载] SQL Server中Case的不同用法
摘要:1): http://soft.zdnet.com.cn/software_zone/2008/0326/783883.shtml2): you can learn more skill about sql in the following url:http://www.1keydata.com/tw/sql/sql-case.html-------------------------------...
阅读全文
[引用]SQL经典面试题及答案
摘要:引自:http://hi.baidu.com/peijixiangchina/blog/item/a1a9352ee9a817524ec2266f.htmlSQL经典面试题及答案1.一道SQL语句面试题,关于group by表内容:2005-05-09 胜2005-05-09 胜2005-05-09 负2005-05-09 负2005-05-10 胜2005-05-10 负2005-05-10 负...
阅读全文
[转] Difference between Abstract classes and Interfaces
摘要:Abstract Class versus Interface引自:http://www.codeproject.com/KB/cs/abstractsvsinterfaces.aspxBy Rahman Mahmoodi | 7 Jan 2008 Abstract class versus Interface: Usage and Implementation. Download source ...
阅读全文
Difference betweeen event and delegate
摘要:Difference betweeen event and delegate is1. Event : An event is a message sent by an object to signal the occurrence of an action. The action could be caused by user interaction, such as a mouse click...
阅读全文
Reason not to use LINQ and reason to use
摘要:1). Are there any good Reasons not to use LINQ in my projcts? We use .Net 3.5 and VSTO 3.0.http://stackoverflow.com/questions/1576679/reason-not-to-use-linq2.When to use LINQ in your design?http://soc...
阅读全文
The difference between svcutil.exe and wsdl.exe (WCF)
摘要:1. Metadata Toolshttp://msdn.microsoft.com/en-us/library/cc304837.aspx2. Web Services Description Language Tool (Wsdl.exe)http://msdn.microsoft.com/en-us/library/7h3ystb6(VS.71).aspx3. ServiceModel Me...
阅读全文
REST of WCF
摘要:Representational State Transferhttp://en.wikipedia.org/wiki/Representational_State_Transfer
阅读全文
What is the difference between Array.Clone and Array.Copy Method
摘要:Array.Clone Method:1).Creates a shallow copy of the Array.--------------------------------------------------------------------------------------------------------------------------------2). Remarks A ...
阅读全文
StructLayoutAttribute- control the physical layout of the data fields of a class or structure.
摘要:StructLayoutAttribute Classhttp://msdn.microsoft.com/en-us/library/system.runtime.interopservices.structlayoutattribute.aspx----------------------------------------------------------------------------...
阅读全文