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
Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double n
Alenkinab [10]

Answer:

showProduct(int,double)

for example: showProduct(10,10.5) is the correct answer even showProduct(10,10.0) is also correct but showProduct(10.0,10.5) or showProduct(10,10) or showProduct(10.0,10) are wrong calls.

Explanation:

The code is

  1.       <em>public static void showProduct (int num1, double num2){</em>
  2. <em>       int product;</em>
  3. <em>       product = num1*(int)num2;</em>
  4. <em>       System.out.println("The product is "+product);</em>
  5. <em>       }</em>

showProduct is function which asks for two arguments whenever it is called, first one is integer and second one is of type double which is nothing but decimal point numbers. Generally, in programming languages, 10 is treated as integer but 10.0 is treated as decimal point number, but in real life they are same.

If showProduct( 10,10.0) is called the output will be 'The product is 100'.

Strange fact is that, if you enter showProduct(10,10.5) the output will remain same as 'The product is 100'. This happens because in the 3rd line of code,which is <em>product=num1*(int)num2</em>, (int) is placed before num2 which makes num2 as of type integer, which means whatever the value of num2 two is given, numbers after decimal is erased and only the integer part is used there.

This is necessary in JAVA and many other programming languages as you <u>cannot</u><u> multiply two different datatypes</u> (here one is int and another is double). Either both of them should be of type int or both should be of type double.

3 0
3 years ago
What is the name of the virus that appears to be a legitimate program?
timurjin [86]
A virus or malware appearing/pretending to be a legitimate program is called a Trojan. 
3 0
3 years ago
30 POINTS FOR THE CORRECT ANSWER
Nonamiya [84]

In the case above, Ruben  should consider the printing option below:

  • Offset litho printing.
  • Digital Printing.
  • Screen printing.

<h3>What is the best printing type for books?</h3>

The use of digital printing is known to be the best in the case with Ruben. It is said to be much more economical in terms of shorter print runs.

Note that Digital printing do have fast turnaround time and as such it is better for books.

Therefore, In the case above, Ruben  should consider the printing option below:

  • Offset litho printing.
  • Digital Printing.
  • Screen printing.

Learn more about printing from

brainly.com/question/145385

#SPJ1

5 0
1 year ago
Which term is used to identify the connection of computers that are physically close to one another?
marta [7]

Answer: Local Area Network (LAN)

Explanation:

A Local Area Network (LAN) is a computer network that interconnects computers within a limited physical area such as a residence, school, laboratory, university campus or office building.

An example of  LAN network is "Phone, Computer and TV connected to a single network (such as a Home Network) via Cables, Wifi, Bluetooth or Hotspot". When the devices are interconnected or connected to a LAN, it becomes accessible between each other.

A simplest example of a LAN Device is a <em>Home Router.</em>

6 0
3 years ago
Read 2 more answers
Define a function below, posodd_number_filter, which takes a single numerical argument. Complete the function to return accepted
Vaselesa [24]

The program is an illustration of functions.

<h3>What are functions?</h3>

Functions are set of program statements that are executed when called or evoked.

<h3>The main program</h3>

The function written in Python, where comments are used to explain each line of the program is as follows:

#This defines the function

def posodd_number_filter(num):

   #This checks if the function is odd and positive

   if num >0 and num%2 ==1:

       #If yes, this returns Accepted

       return "Accepted"

   #If no, this returns Rejected

   return "Rejected"

Read more about functions at:

brainly.com/question/14284563

5 0
2 years ago
Other questions:
  • Which presentation software element can you use to create a model diagram with two concentric circles inside a triangle?
    10·2 answers
  • What is the Multiple Source Test
    15·2 answers
  • Use NumPy to recreate your answer to Question 1b. The input parameters will both be python lists, so you will need to convert th
    8·1 answer
  • Given: an int variable k, an int array current Members that has been declared and initialized, an int variable memberID that has
    11·1 answer
  • The difference between natural and technological system
    9·1 answer
  • What computer is designed to meet the computing needs of several people simultaneously in a small to medium-size business enviro
    5·1 answer
  • discuss the benefits of normalization, and do you think we should normalize our designs to higher levels than 3NF? Why or why no
    9·1 answer
  • - Which amongst the following is not a Characteristic of Cloud Computing?
    5·1 answer
  • Which type of boot authentciation is more secure?
    10·1 answer
  • What is the main difference between weathering, erosion and leaching​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!