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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:23:29+00:00 2026-06-05T01:23:29+00:00

In C# one can instantiate an Array with the special square bracket syntax new

  • 0

In C# one can instantiate an Array with the special square bracket syntax new int[3]. This is different to other types which you instantiate by calling the constructor new List<int>(). Can you use the ordinary syntax to create an Array?

I tried new System.Array<int>(3) but it blows up

The non-generic type ‘System.Array’ cannot be used with type arguments

  • 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-05T01:23:31+00:00Added an answer on June 5, 2026 at 1:23 am

    System.Array itself is abstract, so you won’t be able to instantiate it using its constructor. And as evidenced by your error, it’s not actually generic either; it only gets its type through implementing generic collection interfaces at runtime (see also this related answer):

    Important

    In the .NET Framework version 2.0, the Array class implements the System.Collections.Generic.IList<T>, System.Collections.Generic.ICollection<T>, and System.Collections.Generic.IEnumerable<T> generic interfaces. The implementations are provided to arrays at run time, and therefore are not visible to the documentation build tools.

    For the above reasons, the System.Array class provides a convenience method called CreateInstance() which you can use instead:

    var array = Array.CreateInstance(typeof(int), 3);
    

    Remarks

    Unlike most classes, Array provides the CreateInstance method, instead of public constructors, to allow for late bound access.

    Be very careful when using this method, though, as the resultant array will not be strongly-typed at compile-time! If you want it to be strongly-typed you must cast it after creating it (and no, simply declaring int[] array won’t be enough):

    var array = (int[]) Array.CreateInstance(typeof(int), 3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a constructor function which can be used to instantiate a new Button
As one can glean from other posts , Git's end-of-line normalization has its pros
In C++ one can create an array of predefined size, such as 20, with
Possible Duplicate: Java generics and array initialization How does one instantiate an array of
In IB one can instantiate controllers, build up references to UI elements, and define
Although a static class has only one instance and can't be instantiated, a class
One can remove all calls to printf() using #define printf . What if I
One can create an anonymous object that is initialized through constructor parameters, such as
One can tag files and folders with a color in the Mac OS X
One can create a SeekBar in XML as follows... <SeekBar xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/bpseekbar android:layout_width=fill_parent android:layout_height=wrap_content

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.