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 8466313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:18:23+00:00 2026-06-10T15:18:23+00:00

In some existing piece of code i see the following: public abstract class BasicComponent<T>

  • 0

In some existing piece of code i see the following:

public abstract class BasicComponent<T> : IBasicComponent<T> 
                                          where T : class, new()

I know what an abstract class is, and an interface. But what is it doing with where T and what happends when you extends class and new()?

  • 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-06-10T15:18:24+00:00Added an answer on June 10, 2026 at 3:18 pm

    These are generic type constraints.

    The class means that the T you use must be a class (including interface, delegate and arrays), the new that it must have a public parameterless constructor.

    From the linked MSDN document:

    where T : class –
    The type argument must be a reference type; this applies also to any class, interface, delegate, or array type.

    where T : new() – The type argument must have a public parameterless constructor. When used together with other constraints, the new() constraint must be specified last.

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

Sidebar

Related Questions

I'm working on some existing code. After a few hours, I've boiled this problem
I'm working on some existing c++ code that appears to be written poorly, and
I have some existing code which isn't formatted consistently -- sometimes two spaces are
I have some existing custom Excel workbooks/applications with code-behind C#, which work fine. They
I have some existing code that worked fine under Windows 2003, to obtain the
I am attempting to modify some existing C++ code to work with my needs,
In the interest of reusing some existing code that was defined as an instance
I'm working on modifying some existing code for a payment gateway and I'm not
I have problem to add jQuery to some existing code, please help. We have
I’m converting an existing piece of code using Redemption (an MS Exchange library) to

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.