.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

How do you declare a Numeric type to String?

Posted By :Narayanan     Posted Date :November 21, 2011    Points :40   Category :C# 
Call System.Object.Tostring()
For Example
int idx =0;
string str - idx.ToString();


You can also find related Interview Question to How do you declare a Numeric type to String?  below: 

How do you declare a Numeric type to String?

  
Call System.Object.Tostring()
For Example
int idx =0;
string str - idx.ToString(); (More...)

How do I convert a numeric type to a string?

  
Call Sytem.Object.ToString(). For example, if the variable count is an integer, write the following:
string text = count.ToString(); (More...)

Why do I get an error (CS1006) when trying to declare a method without specifying a return type?

  
If you leave off the return type on a method declaration, the compiler thinks you are trying to declare a constructor. So if you are trying to declare a method that returns nothing, use void. The following is an example: // This results in a CS1006 error public static staticMethod (mainStatic obj) // This will work as wanted public static void staticMethod (mainStatic obj) (More...)

Is string reference type / value type?

  
string is reference type
because String is immutable objects..........
means does not change the values(string)....... (More...)

Why string are called Immutable data Type ?

  
The memory representation of string is an Array of Characters, So on re-assigning the new array of Char is formed & the start address is changed . Thus keeping the Old string in Memory for Garbage Collector to be disposed. (More...)

Why string are called Immutable data Type ?

  
The memory representation of string is an Array of Characters, So on re-assigning the new array of Char is formed & the start address is changed . Thus keeping the Old string in Memory for Garbage Collector to be disposed. (More...)

Is String a primitive type?

  
No, the string is not a primitive type.
However, it has some characteristics common with the primitive types.
The language supports string literals in the code, so that you don't have to explicitly create Stringinstances using the new keyword to get a string object.
There is also support for concatenating strings using the + operator, which the compiler turns into a call to the String.Concat method.
Strings are immutable, which means that it in most situations has value type semantics, just like the primitive types.
(More...)

Can we declare variables with xml data type?

  
Yes, variables can be declared of xml data type that can hold xml data (More...)

Can we declare column with xml data type to hold xml data?

  
Yes, A column with xml data type can be declared. (More...)

Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?

  
(Class constructor method is also known as type constructor or type initializer)
Instance constructor is executed when a new instance of type is created and the class constructor is executed after the type is loaded and before any one of the type members is accessed. (It will get executed only 1st time, when we call any static methods/fields in the same class.) Class constructors are used for static field initialization. Only one class constructor per type is permitted, and it cannot use the vararg (variable argument) calling convention. (More...)

What is type safe?

  
Type safety is about increasing the opportunities for the compiler to detect your coding errors. If you use interfaces instead of delegates the compiler will have more opportunities to detect your coding errors. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend