Anda di halaman 1dari 3

4/15/2015

.NETFramework4.0|JinalDesai.NET

Q.Whatarethemajorimprovementsprovidedbythecommonlanguageruntimeandthebaseclass
libraries?or
Q.WhataretheMajorImprovementsin.NetFramework4.0?
Ans.BriefabouttheImprovements
DiagnosticsandPerformanceStartingwiththe.NETFramework4,youcangetprocessorusageandmemory
usageestimatesperapplicationdomain.
GarbageCollectionThisfeaturereplacesconcurrentgarbagecollectioninpreviousversionsandprovidesbetter
performance.
CodeContractsCodecontractsletyouspecifycontractualinformationthatisnotrepresentedbyamethodsor
typessignaturealone.ThenewSystem.Diagnostics.Contractsnamespacecontainsclassesthatprovidealanguage
neutralwaytoexpresscodingassumptionsintheformofpreconditions,postconditions,andobjectinvariants.
DesignTimeOnlyInteropAssembliesYounolongerhavetoshipprimaryinteropassemblies(PIAs)todeploy
applicationsthatinteroperatewithCOMobjects.Inthe.NETFramework4,compilerscanembedtypeinformation
frominteropassemblies,selectingonlythetypesthatanapplication(forexample,anaddin)actuallyuses.
DynamicLanguageRuntimeThedynamiclanguageruntime(DLR)isanewruntimeenvironmentthataddsa
setofservicesfordynamiclanguagestotheCLR.TheDLRmakesiteasiertodevelopdynamiclanguagestorunonthe
.NETFrameworkandtoadddynamicfeaturestostaticallytypedlanguages.TosupporttheDLR,thenew
System.Dynamicnamespaceisaddedtothe.NETFramework.
CovarianceandContravarianceSeveralgenericinterfacesanddelegatesnowsupportcovarianceand
contravariance.
BigIntegerandComplexNumbersThenewSystem.Numerics.BigIntegerstructureisanintegerdatatypethat
canstorefairlylargenumberasithasnoupperandlowerboundvalues.Complextypesrepresentsacomplexnumberof
forma+bi.ITsupportsarithmeticandtrigonometricoperationswithcomplexnumbers.
TuplesThe.NETFramework4providestheSystem..::.Tupleclassforcreatingtupleobjectsthatcontainstructured
data.
FileSystemEnumerationImprovementsYoucannowenumeratedirectoriesandfilesbyusingmethodsthatreturn
anenumerablecollectionofstringsoftheirnames.oucanalsousemethodsthatreturnanenumerablecollectionof
DirectoryInfo,FileInfo,orFileSystemInfoobjects.
MemoryMappedFilesAmemorymappedfilecontainsthecontentsofafileinvirtualmemoryandisan
applicationslogicaladdressspace.SoYoucanusememorymappedfilestoeditverylargefilesandtocreateshared
memoryforinterprocesscommunication.
64BitOperatingSystemsandProcessesYoucanidentify64bitoperatingsystemsandprocesseswiththe
Environment.Is64BitOperatingSystemandEnvironment.Is64BitProcessproperties.
Q.HowwouldyouDeployyouroldapplicationswith.NetFramework4.0?AretheOldapplications
compatible?
Ans..NETFramework4ishighlycompatiblewithapplicationsthatarebuiltwithearlier.NETFrameworkversions.
data:text/htmlcharset=utf8,%3Cp%20style%3D%22margin%3A%200px%200px%201.2em%3B%20padding%3A%200px%3B%20color%3A%20rgb(99%2C%

1/3

4/15/2015

.NETFramework4.0|JinalDesai.NET

ThoughSomeChangeshavebeenmadetoimprovesecurity,standardscompliance,correctness,reliability,and
performance.
Torunolderapplicationswith.NETFramework4,youwillhavetorecompileyourapplicationswiththetarget.NET
FrameworkversionspecifiedinthepropertiesforyourprojectinVisualStudioOryoucanspecifythesupported
runtimewiththeElementinanapplicationconfigurationfile..NetFramework4doesnotautomaticallyuseitsversion
ofthecommonlanguageruntimetorunapplicationsthatarebuiltwithearlierversionsofthe.NETFramework.
Q.WhtsisParallelComputing?
Ans.Totakeadvantageofmultiplecores(thatis,CPUsorprocessors)youcanparallelizeyourcodesothatitwillbe
distributedacrossmultipleprocessors.Inthepast,parallelizationrequiredlowlevelmanipulationofthreadsand
locks,butVisualStudio2010andthe.NETFramework4enhancesthesupportforparallelprogrammingbyproviding
anewruntime,newclasslibrarytypes,andnewdiagnostictools.Thesefeaturessimplifyparalleldevelopmentsothat
youcanwriteefficient,finegrained,andscalableparallelcodeinanaturalidiomwithouthavingtoworkdirectlywith
threadsorthethreadpool.
ThenewSystem.Threading.Tasksnamespaceandotherrelatedtypessupportthisnewmodel.
Q.WhatisBigIntegerandWhenwouldyouusethat?
Ans.BigInteger,whichisapartofSystem.NumericsNamespaceisagreatenhancementoverByteandInt32datatypes.
Itisanonprimitiveintegraltypethatsupportsarbitrarilylargesignedintegers.UnlikeByteandInt32types,BigInteger
doesnotincludeaMinvalueandMaxValueproperty,socanbeusedtostorelargeintegervalues.
Q.WhatotherthanBigIntegerhasbeenintroducedinSystem.NumericsNamespace?
Ans.Complextypes,whichrepresentsacomplexnumberhasbeenIntroduced.acomplexnumberisanumberinthe
forma+bi,whereaistherealpart,andbistheimaginarypart.
Q.HowdoyouassignaValuetoaComplexNumber.
Ans.Youcanassignavaluetoacomplexnumberinfewdifferentways.
1.BypassingtwoDoublevaluestoitsconstructor.Thefirstvaluerepresentstherealpartofthecomplexnumber,and
thesecondvaluerepresentsitsimaginarypart.
2.ByassigningaByte,SByte,Int16,UInt16,Int32,UInt32,Int64,UInt64,Single,orDoublevaluetoaComplexobject.
Thevaluebecomestherealpartofthecomplexnumber,anditsimaginarypartequals0.
E.gComplexc1=newComplex(12,6)
Console.WriteLine(c1)
OutPut(12,6)
Q.Howhasexceptionhandchangedin.NetFramework4.0
Ans.ANewNamespaceSystem.Runtime.ExceptionServiceshasbeenintroducedwhichprovidesclassesforadvanced
exceptionhandling.Ithasintroducedthefollowingclasses
1.HandleProcessCorruptedStateExceptionsAttributeClassEnablesmanagedcodetohandleexceptionsthatindicate
acorruptedprocessstate.So,Ifyouwanttocompileanapplicationinthe.NETFramework4andhandlecorruptedstate
exceptions,youcanapplythisattributetothemethodthathandlesthecorruptedstateexception.
2.FirstChanceExceptionEventArgsClassProvidesdataforthenotificationeventthatisraisedwhenamanaged
data:text/htmlcharset=utf8,%3Cp%20style%3D%22margin%3A%200px%200px%201.2em%3B%20padding%3A%200px%3B%20color%3A%20rgb(99%2C%

2/3

4/15/2015

.NETFramework4.0|JinalDesai.NET

exceptionfirstoccurs,beforethecommonlanguageruntimebeginssearchingforeventhandlers.

data:text/htmlcharset=utf8,%3Cp%20style%3D%22margin%3A%200px%200px%201.2em%3B%20padding%3A%200px%3B%20color%3A%20rgb(99%2C%

3/3

Anda mungkin juga menyukai