资源描述:
《net方向优秀面试题 ( )(net direction excellent interview question )》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、NET方向优秀面试题(2)((2))(NETdirectionexcellentinterviewquestion(2)(2))1.WhatisthedifferencebetweenclassandstructureinNET?A:thestructureandclasshavethegeneralsyntax,butthestructureismorelimitedthantheclass.Thestructurecannotclaimthatthereisadefaultconstructor,andacopyofthestructureiscreatedand
2、destroyedbythecompiler,sothereisnodefaultconstructoranddestructor.Thestructureisthevaluetype,sothechangestothestructuralvariablesdonotaffecttheiroriginalvalues,buttheclassistheapplicationtype,andchangingthevalueofitsvariablechangesitsoriginalvalue.ThedeclarationstructureUSEStheStruckkey
3、word,whichdeclaresthattheclassUSEStheclasskeywordtopassthestructuretothemethodbyvalue,ratherthanbyreference.Unlikeclasses,theinstantiationofthestructuremaynotusetheNewkeyword.Classescanimplementinterfaces.2.Necessaryconditionsfordeadlock?How?Withtheadvancementofanswer:systemofresourcesh
4、ortage,theorderoftheinappropriate,improperallocationofresources,aresourcecanonlybeusedbyoneprocessatatime,aresourcerequestresources,andtheresourcehasbeenblockedatthistime,toobtainresourcesandprocessestoobtainresources,beforehasnotusedup,can'tforciblydeprived.3.Cantheinterfaceinheritthei
5、nterface?Canabstractclassesimplementinterfaces?Canabstractclassesinheritentities?Answer:interfacescanbeinherited,isanabstractclasscanimplementtheinterface,anabstractclasscaninheritentityclass,butthereisacondition,conditionisthatthestructureoftheentityclassmusthaveaclearfunction.4.CanCon
6、structorconstructionbeinherited?CanitbeOverride?A:Constructorcannotbeinherited,soyoucan'tberewritten(Overriding),butcanbeoverloaded(Overloading).5.CanIinheritaStringclass?Answer:becausetheStringclassisfinalclass,youcan'tinherittheStringclass.5.Whenathreadentersamethodofanobject,canother
7、threadsentertheobject'smethod?Answer:no,anobject'smethodcanonlybeaccessedbyonethread.6.Usethemosteffectivemethodtocalculatethenumberof8.A:2<<3.7.Canc#beoperateddirectlyonmemory?Answer:thisquestionismoredifficulttoanswer,alsoisabigquestion.Butyoucananswerthatquestion.C#canbedire