Results 1 to 3 of 3

Thread: Static types can we used as return type

  1. #1
    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.

  2. #2
    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() {
    }
    }

  3. #3
    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;
    }

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,975,098.81428 seconds with 16 queries