Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 12-06-2009
Member
 
Join Date: Oct 2008
Posts: 101
Static types can we used as return type

I have some programming code applied in my order management system, I used some of the static methods in it, which is expecting return value from the method, but i am not able to understand whether should we use static method as return type. please correct if i am wrong.
Reply With Quote
  #2  
Old 12-06-2009
Member
 
Join Date: Dec 2008
Posts: 183
Re: Static types can we used as return type

As per my knowledge you cannot make your method return type with the static method, this is no allowed. you may check from here:

Code:
class VirtualGrid<T>
where T : ModelGenericBase<T> {

void test() {
//'T' is a 'type parameter', which is not valid in the given context
T.test1();
}
}

class ModelGenericBase<T> {
public static void test1() {
}
}
Reply With Quote
  #3  
Old 12-06-2009
Member
 
Join Date: Dec 2008
Posts: 161
Re: Static types can we used as return type

The point of a static class is that there are no instances of it -you therefore could never have a variable of that type which had any value other than null.

In your code, you have:

public HOW_GOOD HowAreYouDoing(string MyName)
{
return HOW_GOOD.NOT_TOO_BAD;
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Static types can we used as return type"
Thread Thread Starter Forum Replies Last Post
Convert reference types in value type and vice versa Terawa Software Development 3 13-02-2011 07:41 AM
what are the possible return types of a main method? \"Dritan\" Software Development 3 08-01-2011 03:50 AM
Implement the return type in java Captain Carrot Software Development 4 25-03-2010 01:34 PM
Method with multiple return types ISAIAH Software Development 5 25-02-2010 05:10 AM
ArrayList and type the return manjava Software Development 2 09-05-2009 11:15 PM


All times are GMT +5.5. The time now is 08:02 PM.