Wednesday, 20 March 2013

Delphi Package can contain components, non - visual classes, but not forms.

a) True
b) False
 
Answer : b. False

Which of the follo wing is not a valid calling convention for 32 - bit Delphi routines?

a) register
b) dynamic
c) stdcall
d) cdecl
 
Answer :b. dynamic
 

What is the underlying type of the TDateTime type?

a)  Double
b) TObject
c) String
d) Integer
 
Answer : a: Double

In the Delphi language, which symbols or words define the start and end of a code block?

 
a) { }
b) [ ]
c) start end
d) begin end.
 
Answer : D : begin end.
 

used and what's the difference between FreeAndNil and Free method

Free -  Deallocate the memory previously allocated for the object
nil - Dereference the object

When an object is created like

Query1 := TQuery.Create(nil)

It creates the instance and allocate some memory space to hold the data of Query1

When Free is called - It frees the memory of space already allocated for Query1
When nil is called - It sets the pointer to  nil

Always try to use FreeAndNil instead of Free And Nil separately

What is Different between Parent and Owner in Delphi.

Parent is immediate ancestor of Component. IT provide To context to draw the controls.

Owner is the component responsible for making sure it's destroyed and Container of All Component is also known as Owner.