SlideShare a Scribd company logo
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

PPT
Core java day4
PPTX
Code craftsmanship saturdays second session
PDF
Adding Random Operations to OCL
PPTX
Qtp training session IV
PDF
[@NaukriEngineering] Feature Toggles
PDF
Mock object
PDF
Overriding methods
PPTX
Java Chapter 05 - Conditions & Loops: part 3
Core java day4
Code craftsmanship saturdays second session
Adding Random Operations to OCL
Qtp training session IV
[@NaukriEngineering] Feature Toggles
Mock object
Overriding methods
Java Chapter 05 - Conditions & Loops: part 3

What's hot (20)

PDF
A low Overhead Per Object Write Barrier for Smalltalk
PPTX
Introduction to RxJava on Android
PDF
Reflection in Pharo: Beyond Smalltak
PDF
Introduction to RxJS
PDF
Reflection in Pharo: Beyond Smalltak
PPTX
PPTX
QTP Presentation
PDF
AngularJS
PPTX
A Proposal to Orchestrate Test Cases
PDF
Dynamically Composing Collection Operations through Collection Promises
PPTX
Javascript: master this
PDF
Streams, Streams Everywhere! An Introduction to Rx
PPTX
Presentation on overloading
PDF
Functional Programming 101 for Java 7 Developers
PPTX
Constructor and destructor
ODP
Functional programming in Javascript
PDF
RxJava@Android
PDF
Variables in Pharo5
PDF
Swift, a quick overview
A low Overhead Per Object Write Barrier for Smalltalk
Introduction to RxJava on Android
Reflection in Pharo: Beyond Smalltak
Introduction to RxJS
Reflection in Pharo: Beyond Smalltak
QTP Presentation
AngularJS
A Proposal to Orchestrate Test Cases
Dynamically Composing Collection Operations through Collection Promises
Javascript: master this
Streams, Streams Everywhere! An Introduction to Rx
Presentation on overloading
Functional Programming 101 for Java 7 Developers
Constructor and destructor
Functional programming in Javascript
RxJava@Android
Variables in Pharo5
Swift, a quick overview
Ad

Similar to Csharp (20)

PPTX
More topics on Java
PPTX
Memory Management & Garbage Collection
PPTX
2. overview of c#
PDF
Klee and angr
PPTX
Beirut Java User Group JVM presentation
PPTX
Easy mock
PPT
Arrays
PDF
iOS Programming Intro
PDF
Louis Loizides iOS Programming Introduction
PPTX
Ahieving Performance C#
KEY
Exciting JavaScript - Part I
PPTX
Module_2_1_Building Python Programs_Final.pptx
PPTX
Exception handling in java
PPTX
Operators loops conditional and statements
PPT
Exception
PPT
Exception
PPT
Exception
PPT
Exception
PPT
Exception
PPT
Exception
More topics on Java
Memory Management & Garbage Collection
2. overview of c#
Klee and angr
Beirut Java User Group JVM presentation
Easy mock
Arrays
iOS Programming Intro
Louis Loizides iOS Programming Introduction
Ahieving Performance C#
Exciting JavaScript - Part I
Module_2_1_Building Python Programs_Final.pptx
Exception handling in java
Operators loops conditional and statements
Exception
Exception
Exception
Exception
Exception
Exception
Ad

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.