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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:30:10+00:00 2026-05-22T17:30:10+00:00

I quote the following paragraphs from the book: The C# Programming Language Fourth Edition

  • 0

I quote the following paragraphs from the book:
The C# Programming Language
Fourth Edition

C# supports single- and
multi-dimensional arrays of any type.
Unlike the types listed above, array
types do not have to be declared
before they can be used. Instead,
array types are constructed by
following a type name with square
brackets. For example, int[] is a
single-dimensional array of int,
int[,] is a two-dimensional array of
int, and int[][] is a
single-dimensional array of
single-dimensional arrays of int.

and

Nullable types also do not have to be
declared before they can be used. For
each non-n ullable value type T there
is a corresponding nullable type T?,
which can hold an additional value
null. For instance, int? is a type
that can hold any 32 bit integer or
the value null.

How to use array and nullable types without declaring them in advance?

  • 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-22T17:30:10+00:00Added an answer on May 22, 2026 at 5:30 pm

    Short answer

    What those quotations are trying to say is that you don’t have to “create” (or declare) array and nullable value types, in the same way you declare custom classes, in order to use them. They are already available as C# language features.

    Long answer

    If you want to declare an array of ints, simply do this:

    int[] intArray = new int[5];
    

    If you made a custom class, for example Foo, and you want to declare an array of Foo objects, the first quotation is saying that you don’t have to write code to tell the compiler about an array type that can hold Foo objects; just do this and the compiler will figure out the rest:

    Foo[] fooArray = new Foo[5];
    

    Similarly, to create items of nullable value types simply append ? to the type:

    int? nullableInt = null;
    

    Additionally, the above is just syntactic sugar for the Nullable<T> struct:

    Nullable<int> nullableInt = null;
    

    Note that this only applies to value types (including structs), as all reference types (objects, delegates, etc) are nullable by default.

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

Sidebar

Related Questions

The following quote is from this link: http://apidocs.meego.com/1.2-preview/qtmobility/qgeopositioninfosource.html#createDefaultSource Creates and returns a position source
The following quote is from C++ Templates by Addison Wesley . Could someone please
The following quote is from this link: http://doc.qt.io/qt-5/qwidget.html#setLayout If there already is a layout
How do I convert image to grayscale? I have the following quote from the
I have the following lines in my ~/.emacs.d/init.el (custom-set-variables '(flymake-allowed-file-name-masks (quote ( (\\.cc\\' flymake-simple-make-init)
Consider the following two alternatives: console.log("double"); console.log('single'); The former uses double quotes around the
I heard the following quote once, but forgot to whom it is attributed: While
I have just started learning Objective-C, I am reading Programming in Objective-C 3rd Edition
The raw data looks like the following: YAPM1,20100901,23:36:01.563,Quote,,,,,,,4563,,,,,, YAPM1,20100901,23:36:03.745,Quote,,,,,4537,,,,,,,, The first row has extra
I am working through Kip Irvine's "Assembly Language for x86 Processors, sixth edition" and

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.