Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6193895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:12:04+00:00 2026-05-24T03:12:04+00:00

**Preface I’m very new to generics. I have a class I created called Geno.

  • 0

**Preface I’m very new to generics. I have a class I created called Geno. My Peno class simply contains a string Name property. I’m wondering why I cannot call T.Name from within a method on this class. How would I access the properties on T? Any good resources on how this works?

public class Geno<T> where T : Peno
{

}

public string GetName()
{
   return T.Name;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:12:05+00:00Added an answer on May 24, 2026 at 3:12 am

    Is your Name property an instance property or a static property? If it’s a static property, you don’t get polymorphism anyway – you could just call Peno.Name.

    If it’s an instance property, you need an instance on which to call it. For example:

    public class Geno<T> where T : Peno
    {
        private readonly T value;
    
        public Geno(T value)
        {
            this.value = value;
        }
    
        public string GetName()
        {
           return value.Name;
        }    
    }
    

    If this doesn’t help, please give a more complete example of what you’re trying to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To preface, I'm very new to Obj-C but I do have some OOP experience
Preface: I'm very new to objective-c and I am doing simple exercises to learn
Please let me preface this question with an apology. I am very new to
To preface: I am very new to C, so I am probably missing something
To preface this question, this is my first app and I have a very
Preface : I am new to the iPhone SDK, Obj-C, Interface Builder and Cocoa.
Preface: I have two entities defined as a one-to-many relationship: A <<-------> B. B's
Preface: I am sure this is incredibly simple, but I have searched this site
Preface: I have a demo of the problem on my personal site (I hope
Preface: I have a MS Access 2010 front end running against a MySQL back

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.