IT Community - Software Programming, Web Development and Technical Support

error (CS1006) when trying to declare a method without specifying a return type

This is a discussion on error (CS1006) when trying to declare a method without specifying a return type within the C# Programming forums, part of the Software Development category; Hui Guys can anybody tell me Why do I get an error (CS1006) when trying to declare a method without ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-01-2007, 04:49 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Question error (CS1006) when trying to declare a method without specifying a return type

Hui Guys can anybody tell me Why do I get an error (CS1006) when trying to declare a method without specifying a return type?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-01-2007, 04:54 AM
H2o H2o is offline
D-Web Analyst
 
Join Date: Jul 2007
Posts: 246
H2o is on a distinguished road
Smile Re: error (CS1006) when trying to declare a method without specifying a return type

Dear Vignesh,

Have you tried to declare a method that returns nothing, use void.

The following lines will get you clear idea:

public static staticMethod (mainStatic obj)
// This will result in a CS1006 error

public static void staticMethod (mainStatic obj)
// This will work correctly
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I return two values to a form? S.Vinothkumar PHP Programming 5 10-16-2007 07:29 AM
What is Value type and reference type in .Net? anbuchezhians VB.NET Programming 2 08-21-2007 10:42 PM
void return type anbuchezhians Java Programming 1 07-25-2007 05:55 AM
declare an array of N pointers to functions returning ? sundarraja C and C++ Programming 0 07-25-2007 04:58 AM
What's the Reason for getHeight() method not return the correct value in Game canvas? mobilegeek Mobile Software Development 1 07-19-2007 01:06 AM


All times are GMT -7. The time now is 12:33 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0