What is the difference between typeof(foo) and myFoo.GetType()?

Answers were Sorted based on User's Feedback



What is the difference between typeof(foo) and myFoo.GetType()?..

Answer / enso

Operator typeof(foo) is used to obtain the System.Type
object for a type at compile time.

myFoo.GetType() is used to obtain the exact run time type of
an object. This method uses reflection.

Is This Answer Correct ?    11 Yes 1 No

What is the difference between typeof(foo) and myFoo.GetType()?..

Answer / nidhi

Operator typeof(foo) is used to obtain the System.Type
object for a type at compile time.
myFoo.GetType() is used to obtain the exact run time type of
an object. This method uses reflection.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C Interview Questions

what is c

1 Answers  


Explain what is a stream?

0 Answers  


Can we initialize extern variable in c?

0 Answers  


what are threads ? why they are called light weight processes ? what is the relation between process and threads ?

1 Answers  


explain memory layout of a C program

2 Answers  






What is && in c programming?

0 Answers  


which one low Priority in c? a)=,b)++,c)==,d)+

10 Answers  


Write a program to use switch statement.

0 Answers   Agilent, Integreon, ZS Associates,


char p="data"; printf(p);

2 Answers  


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

0 Answers   L&T,


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

0 Answers  


What is an array in c?

0 Answers  


Categories