Creating C# method, where do the parameters contain?

Asked

Viewed 52 times

0

What is the point of adding "?" in front of the parameter variable? Example:

public void somar(int n1, Date data?){

}

OR

public void somar(int n1, Date? data){

}
  • The second example is to say that that parameter is nullable. That is, an int, of course, cannot receive null, only one number, with already int? can get null. Now I’ve never seen the first example.

  • This is not related to the parameter but to the type.

  • Thank you, guys.

1 answer

2


Browser other questions tagged

You are not signed in. Login or sign up in order to post.