1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nataly [62]
3 years ago
7

Reference variables allow arguments to be passed by ____________.

Computers and Technology
1 answer:
son4ous [18]3 years ago
7 0

Answer:

Reference

Explanation:

The Reference type variable is such type of variable in C# that holds the reference of memory address instead of value. Examples for reference type are classes, interfaces, delegates and arrays.

We can pass parameters to the method by reference using <em>ref </em>keyword

It’s mandatory to initialize the variable value before we pass it as an argument to the method in c#

For example,

int x = 10;  // Variable need to be initialized

Add(ref x); // method call

If you pass parameters by reference in method definition, any changes made to it affect the other variable in method call.

Here's a sample program:

using System;

namespace ConsoleApplication

{

   public class Test

   {

       public static void Main()

       {

           int i = 10;

           Console.WriteLine("i=" + i);

           Add(ref i);

           Console.WriteLine("i=" + i);

           Console.ReadLine();

       }

       public static void Add( ref int j)

       {

           j = j + 10;

           Console.WriteLine("j="+j);

       }

   }

}

Output:

i=10

j=20

i=20

You might be interested in
What two skills are most important for a meteorologist
Komok [63]

being able to find out the weather.


being able to wear fancy suits.

7 0
3 years ago
Read 2 more answers
Which option describes wearable technology?
kotykmax [81]
My opinion is the answers A and D. I would choose A if you can only choose one, though.
7 0
3 years ago
Read 2 more answers
Danica now wants to add a picture of her cookies to her flyer.
gavmur [86]

Answer:

C for Edgenuity

Explanation:

-Ted from Ted Talk

6 0
3 years ago
Read 2 more answers
3X5
iren2701 [21]

Answer:

Explanation:

No idea bro

7 0
2 years ago
Write an application that accepts a word from a user and converts it to Pig Latin. If a word starts with a consonant, the Pig La
Reptile [31]

Answer:

Written in Python

word = input("Word: ")

if(word[0]=='a' or word[0]=='e' or word[0]=='i' or word[0] =='o' or word[0]=='u'):

     print(word+"ay")

else:

     a = word[1:]

     print(a+word[0]+"ay")

Explanation:

<em>The program was written in Python and I've added the explanation as an attachment; where I used comments as explanations</em>

Download txt
5 0
3 years ago
Other questions:
  • What happens to formulas with relative cell references when they are copied using the fill handle?
    12·1 answer
  • Please Help!! Digital Information Technology Class!!
    12·2 answers
  • SQL statement to verify the updated name field for the publisher with ID 5 SELECT * FROM Publisher WHERE PubID=5;
    7·1 answer
  • Public class Main{ public static void main(String [] args){ String name=WelcomeJava; Runnable r1=() -&gt; System.out.println(nam
    12·1 answer
  • so i just went to play forge of empires and when i logged on to it all of my progress was gone and i was so far in to it
    15·2 answers
  • Different between input and output device​
    5·1 answer
  • Explain the evolution of programming language​
    15·1 answer
  • 1. Create an optimized function "print s(n,s)" that prints the given argument s (representing a string) k times. k represents th
    7·1 answer
  • Why do my airpods keep disconnecting from my laptop
    8·2 answers
  • A multiprocessor with 10 processors has 36 attached tape drives. A number of jobs have been submitted to the system where each j
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!