What is the difference between TypeOf and GetType?

Answer Posted / avinash reddy r

typeOf is based on a class

Ex: Console.WriteLine(typeof(int))
O/P: System.Int32


GetType is based on a object

string s="Hello World"

Ex: Console.WriteLine(s.GetType())

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Please explain value types and reference types used in c#?

478


How does bitwise xor work?

471


Where do we use serialization in c#?

498


What is distribute by in hive?

542


What is the use of readkey in c#?

495






What is a helper method in c#?

478


What is an example of a delegate?

512


What are data types with examples?

512


What does the dispose method do with the connection object?

537


What is generic delegates in c#?

531


Why do I get a "cs5001: does not have an entry point defined" error when compiling?

513


What is an assembly qualified name

524


What is private constructor c#?

501


Is c# still popular?

491


Hi to all..I have to create an intranet application on C#.NET windows Application so please please let can you people help me as iam new in .NET and if u have any samples or website address from where i can get sample please let know.

3804