Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

i have a question which is quite simple but yet complicated
for me
my question is why do we use void, if it does not return
anything to the compiler?
if it is used for normal display it can also be done by
what is called Console.Write() or Consol.WriteLine() and if
i do not use void with my method then my compiler throws me
an error. if i return a value say integer then i write
public int fun() display of the result can also be done
here
then why is it so necessary to use void with a function and
why so compiler throw us an error if v don't use void
return type?

Answer Posted / n r s reddy

Hi buddy...

its as simple as your questino.

By using key word VOID, just its an informationto the
comiler stating that following code is not goig to return
anything. Where we can save some resources like memory
etc... from functionality point of view.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is better C# or VB.NET?

984


What is a property c#?

1091


What is default parameter in c#?

1018


What is the diff between System.String and System.Text.StringBuilder classes?

1065


What you mean by inner exception in c#?

1016


How to use the sreamReader class to read form a text file?

1034


What does break do in loop?

995


Can we instantiate abstract class in c#?

945


What is returned if you pass the value 12.34 to the parsefloat () function?

1008


What is the difference between == and object.equals?

1066


How does dictionary work in c#?

936


Are arrays immutable c#?

1122


hi all.... i need code snippets for store and retrive tiff fromat images in sqlserver....... kindy provide it.......

1887


what is the purpose of using statement in c#

1054


What is xslt in c#?

919