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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:17:41+00:00 2026-05-13T12:17:41+00:00

private enum E_Week { Mon = 0, Tue, . . . } What does

  • 0
private enum E_Week
{
   Mon = 0,
   Tue,
   . . .
}

What does the following code mean?

E_Week? week= null;

Is it equal to the following code? What is the function of the ‘?’ sign here?

E_Week week= null;
  • 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-13T12:17:41+00:00Added an answer on May 13, 2026 at 12:17 pm

    Your code is using what’s called a nullable type. An enum, much like an int or a DateTime, is what is known as a “value type”, which is required to always have some value. Nullable types allow you to treat value types as if they do allow null values.

    For example, this code is invalid and won’t compile because enums cannot be null:

    E_Week week = null;
    

    But this code is valid:

    E_Week? week = null;
    

    And it’s exactly the same as this:

    Nullable<E_Week> week = null;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's assume we've got the following Java code: public class Maintainer { private Map<Enum,
Example code : public enum Foods { Burger, Pizza, Cake } private void button1_Click(object
The following code fails with a NullPointerException in main (map==null) . The issue occurs
I've got an enum defined as such: Private Enum AllowedMonthNumbers _1 _2 _3 _4
I'm trying to access my class's private enum. But I don't understand the difference
It seems to be possible in Java to write something like this: private enum
Public Enum Fruit Red_Apple = 1 Oranges Ripe_Banana End Enum Private Sub InitCombosRegular() Dim
I have a class with a private member ( struct ) as follows: enum
The first one is enum class enum coffeeSize{ BIG(8), HUGE(10), OVERWHELMING(16); private int ounces;
This is an elaboration on this question: c# Enum Function Parameters I created a

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.