O'Reilly logo

Beginning C# 7 Hands-On – The Core Language by Tom Owsiak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Value type variables

Now, let's also make another method as follows:

private static void ChangeValue(double x){    x = 30;}

You've seen most of this, except perhaps the x = 30; line; so add comment 7 at the end of this line as follows:

//7. Setting the value 30 to x will not change the argument where the method is called

For clarity, the following code block shows what your code should look like up to this point:

//1. using is a keyword, it's blue//2. System is a name space that stores already created code//3. using System brings in existing codeusing System;//4. class is a required container for creating our own code samplespublic partial class _Default : System.Web.UI.Page{    private static void ChangeArray(int[] arr)    {  //5. void means do not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required