SlideShare a Scribd company logo
1 of 2
What is the difference between finally and finalize in csharp ?

Finally:


     •     It is use in exceptional handling.
     •     It uses with try-catch block
     •     It will always execute no matter try block get error.
     •     It is uses when we want particular code execute in any case.
     •     It is only one with one try block.


Finalize():

     •     The Finalize method is used to perform cleanup operations on unmanaged resources held by the
           current object before the current object is destroyed.
     •     In C# destructor are converted to finalize method by C# compiler.
     •     The scope of the Object.Finalize method is protected.
     •     The Finalize() destructor is called after the last reference to an object is released from the
           memory.
     •     It is automatically called by garbage collector to release resource.
     •     The exact time when the finalizer executes during garbage collection is undefined.



What is the Difference between IN and Exists in SQL Server 2005? Give the brief
explanation?

using the IN clause, you're telling the rule-based
optimizer that you want the inner query to drive the outer
query (think: IN = inside to outside).

When you write EXISTS in a where clause, you're telling the
optimizer that you want the outer query to be run first,
using each value to fetch a value from the inner query
(think: EXISTS = outside to inside).


SELECT xyz FROM Table WHERE EXISTS (SELECT...)



If EXISTS subquery return one or more results, WHERE condition is evaluated as
TRUE, If subquery returns empty result set, WHERE condition is evaluated as
FALSE. No matter on returned data by subquery but only empty result or any
result.



SELECT xyz FROM Table WHERE column1 IN (1,2,3)
SELECT xyz FROM Table WHERE column1 IN (SELECT ....)



IN compare two values - column1 and all values returned by subquery or 1,2,3
values.

More Related Content

What's hot

A low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkA low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkESUG
 
Introduction to RxJava on Android
Introduction to RxJava on AndroidIntroduction to RxJava on Android
Introduction to RxJava on AndroidChris Arriola
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakMarcus Denker
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJSBrainhub
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakMarcus Denker
 
QTP Presentation
QTP PresentationQTP Presentation
QTP Presentationamittech3
 
A Proposal to Orchestrate Test Cases
A Proposal to Orchestrate Test CasesA Proposal to Orchestrate Test Cases
A Proposal to Orchestrate Test CasesBoni García
 
Dynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection PromisesDynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection PromisesMarcus Denker
 
Streams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to RxStreams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to RxAndrzej Sitek
 
Presentation on overloading
Presentation on overloading Presentation on overloading
Presentation on overloading Charndeep Sekhon
 
Functional Programming 101 for Java 7 Developers
Functional Programming 101 for Java 7 DevelopersFunctional Programming 101 for Java 7 Developers
Functional Programming 101 for Java 7 DevelopersJayaram Sankaranarayanan
 
Constructor and destructor
Constructor and destructorConstructor and destructor
Constructor and destructorrajshreemuthiah
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in JavascriptKnoldus Inc.
 
Swift, a quick overview
Swift, a quick overviewSwift, a quick overview
Swift, a quick overviewJulian Król
 

What's hot (20)

A low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkA low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for Smalltalk
 
Introduction to RxJava on Android
Introduction to RxJava on AndroidIntroduction to RxJava on Android
Introduction to RxJava on Android
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJS
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
Roslyn
RoslynRoslyn
Roslyn
 
QTP Presentation
QTP PresentationQTP Presentation
QTP Presentation
 
AngularJS
AngularJSAngularJS
AngularJS
 
A Proposal to Orchestrate Test Cases
A Proposal to Orchestrate Test CasesA Proposal to Orchestrate Test Cases
A Proposal to Orchestrate Test Cases
 
Dynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection PromisesDynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection Promises
 
Javascript: master this
Javascript: master thisJavascript: master this
Javascript: master this
 
Streams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to RxStreams, Streams Everywhere! An Introduction to Rx
Streams, Streams Everywhere! An Introduction to Rx
 
Presentation on overloading
Presentation on overloading Presentation on overloading
Presentation on overloading
 
Functional Programming 101 for Java 7 Developers
Functional Programming 101 for Java 7 DevelopersFunctional Programming 101 for Java 7 Developers
Functional Programming 101 for Java 7 Developers
 
Constructor and destructor
Constructor and destructorConstructor and destructor
Constructor and destructor
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in Javascript
 
RxJava@Android
RxJava@AndroidRxJava@Android
RxJava@Android
 
Unit testing basics
Unit testing basicsUnit testing basics
Unit testing basics
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
Swift, a quick overview
Swift, a quick overviewSwift, a quick overview
Swift, a quick overview
 

Similar to Csharp

More topics on Java
More topics on JavaMore topics on Java
More topics on JavaAhmed Misbah
 
Memory Management & Garbage Collection
Memory Management & Garbage CollectionMemory Management & Garbage Collection
Memory Management & Garbage CollectionAbhishek Sur
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#Rohit Rao
 
Beirut Java User Group JVM presentation
Beirut Java User Group JVM presentationBeirut Java User Group JVM presentation
Beirut Java User Group JVM presentationMahmoud Anouti
 
iOS Programming Intro
iOS Programming IntroiOS Programming Intro
iOS Programming IntroLou Loizides
 
Louis Loizides iOS Programming Introduction
Louis Loizides iOS Programming IntroductionLouis Loizides iOS Programming Introduction
Louis Loizides iOS Programming IntroductionLou Loizides
 
Exciting JavaScript - Part I
Exciting JavaScript - Part IExciting JavaScript - Part I
Exciting JavaScript - Part IEugene Lazutkin
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javaAdil Mehmoood
 
Operators loops conditional and statements
Operators loops conditional and statementsOperators loops conditional and statements
Operators loops conditional and statementsVladislav Hadzhiyski
 

Similar to Csharp (20)

More topics on Java
More topics on JavaMore topics on Java
More topics on Java
 
Memory Management & Garbage Collection
Memory Management & Garbage CollectionMemory Management & Garbage Collection
Memory Management & Garbage Collection
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#
 
Klee and angr
Klee and angrKlee and angr
Klee and angr
 
Beirut Java User Group JVM presentation
Beirut Java User Group JVM presentationBeirut Java User Group JVM presentation
Beirut Java User Group JVM presentation
 
Easy mock
Easy mockEasy mock
Easy mock
 
Arrays
ArraysArrays
Arrays
 
iOS Programming Intro
iOS Programming IntroiOS Programming Intro
iOS Programming Intro
 
Louis Loizides iOS Programming Introduction
Louis Loizides iOS Programming IntroductionLouis Loizides iOS Programming Introduction
Louis Loizides iOS Programming Introduction
 
Ahieving Performance C#
Ahieving Performance C#Ahieving Performance C#
Ahieving Performance C#
 
Exciting JavaScript - Part I
Exciting JavaScript - Part IExciting JavaScript - Part I
Exciting JavaScript - Part I
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Operators loops conditional and statements
Operators loops conditional and statementsOperators loops conditional and statements
Operators loops conditional and statements
 
Exception
ExceptionException
Exception
 
Exception
ExceptionException
Exception
 
Exception
ExceptionException
Exception
 
Exception
ExceptionException
Exception
 
Exception
ExceptionException
Exception
 
Exception
ExceptionException
Exception
 
Exception
ExceptionException
Exception
 

Csharp

  • 1. What is the difference between finally and finalize in csharp ? Finally: • It is use in exceptional handling. • It uses with try-catch block • It will always execute no matter try block get error. • It is uses when we want particular code execute in any case. • It is only one with one try block. Finalize(): • The Finalize method is used to perform cleanup operations on unmanaged resources held by the current object before the current object is destroyed. • In C# destructor are converted to finalize method by C# compiler. • The scope of the Object.Finalize method is protected. • The Finalize() destructor is called after the last reference to an object is released from the memory. • It is automatically called by garbage collector to release resource. • The exact time when the finalizer executes during garbage collection is undefined. What is the Difference between IN and Exists in SQL Server 2005? Give the brief explanation? using the IN clause, you're telling the rule-based optimizer that you want the inner query to drive the outer query (think: IN = inside to outside). When you write EXISTS in a where clause, you're telling the optimizer that you want the outer query to be run first, using each value to fetch a value from the inner query (think: EXISTS = outside to inside). SELECT xyz FROM Table WHERE EXISTS (SELECT...) If EXISTS subquery return one or more results, WHERE condition is evaluated as TRUE, If subquery returns empty result set, WHERE condition is evaluated as FALSE. No matter on returned data by subquery but only empty result or any result. SELECT xyz FROM Table WHERE column1 IN (1,2,3)
  • 2. SELECT xyz FROM Table WHERE column1 IN (SELECT ....) IN compare two values - column1 and all values returned by subquery or 1,2,3 values.