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
Naily [24]
4 years ago
7

The following problem illustrates the way memory aliasing can cause unexpected program behavior. Consider the following function

to swap two values
void swap(int xp, int yp)
If this procedure is called with xp equal to yp (i.e. both xp and yp point to the same integer) what effect will it have compared to the situation where xp and yp point to different integers?
a. The value will ahways be the original value in the integer pointed to by xp.
b. It is not possible for xp and yp to have the same value
c. The value will always be zero.
d. The value will always be the original value in the integer pointed to by yp.
e. It will be the same - doesn't matter
Computers and Technology
1 answer:
laila [671]4 years ago
5 0

Answer:

A

Explanation:

The value will be the original stored in the int variables. This is because the method swap(int xp, int yp) accepts xp and yp parameters by value (They are passed by value and not by reference). Consider the implementation below:

public class Agbas {

   public static void main(String[] args) {

   int xp = 2;

   int yp = xp;

   swap(xp,yp); //will swap and print the same values

       System.out.println(xp+", "+yp); // prints the original in values 2,2

 int xp = 2;

   int yp = 5;

   swap(xp,yp); // will swap and print 5,2

       System.out.println(xp+", "+yp); // prints the original in values 2,5

   }

   public static void swap(int xp, int yp){

       int temp = xp;

       xp = yp;

       yp = temp;

       System.out.println(xp+", "+yp);

   }

}

You might be interested in
which two statements about incoming and outgoing interfaces in firewall policies are true? (choose two.)
Ratling [72]

The statements that are true regarding incoming and outgoing interfaces in firewall policies are:

  • A zone can be chosen as the outgoing interface.
  • -Multiple interfaces can be selected as incoming and outgoing interfaces.

<h3>What is a firewall?</h3>

A firewall is a network security device used in computing that monitors and regulates incoming and outgoing network traffic in accordance with pre-established security rules. Typically, a firewall creates a wall between a trustworthy network and an unreliable network, like the Internet.

A firewall aids in defending your network from intruders. A firewall protects your network by operating as a continuous filter that constantly scans incoming data and blocks anything that appears to be suspicious.

Therefore, the statements that are true regarding incoming and outgoing interfaces in firewall policies are:

A zone can be chosen as the outgoing interface.

-Multiple interfaces can be selected as incoming and outgoing interfaces.

Learn more about firewall on:

brainly.com/question/13693641

#SPJ1

Which statements are true regarding incoming and outgoing interfaces in firewall policies? (Choose two.)

Select one or more:

-An incoming interface is mandatory in a firewall policy, but an outgoing interface is optional.

-A zone can be chosen as the outgoing interface.

-Only the any interface can be chosen as an incoming interface.

-Multiple interfaces can be selected as incoming and outgoing interfaces.

4 0
2 years ago
Dave is a recruiter for a large video and animation firm. He is looking for an employee who is willing to give productive hours
kumpel [21]

Answer:

reliabitlity

Explanation:

3 0
3 years ago
- If we place records from different tables in adjacent____________, it would increase efficiency of a database.
tiny-mole [99]

Answer: Physical location

Explanation:

If we place records from, different tables in adjacent physical location, it would increases efficiency of a databases as, database consolidates records from previously store in separate files into a common file. Databases are fast and efficient when they are dealing with large data. When all the information is stored in multiple physical location it is also known as distributed database, as physical location helps to provide the physical and logical path and also protect from default locations in the database.

3 0
4 years ago
Your organization will be handling market trades. You will be required to verify the identify of each customer who is executing
zmey [24]

Answer:

The correct answer for the following question will be Digital certificate.

Explanation:

An electronic "password" that allows an organization or person to exchange information (data) with security using the public key infrastructure (PKI) over the internet called as Digital certificate. And is also known as Public key certificate and identity certificate.

Digital certificate contains the following things :

  • Copy of certificate holder public key.
  • Name of certificate holder.
  • Serial number which is used to uniquely identify a certificate.
  • Expiration dates.
  • Digital signature of certificates.

What security provided :

  • Identification/Authentication.
  • Access Control.
  • Non-Repudiation.
  • Integrity.

 

5 0
4 years ago
Jerry is entering information from the documents that show what customers bought and what they owe. What document is he working
il63 [147K]
The answer would be C. Invoice
4 0
3 years ago
Read 2 more answers
Other questions:
  • Software that interprets commands from the keyboard and mouse is also known as the A.hard drive.B.operating system.C.desktop or
    7·2 answers
  • Bitlocker uses the computer's __________ chip to store encryption keys and does not rely on individual user credentials. securit
    10·1 answer
  • What is the name of the symbol that is used to classify and categorize information?​
    10·2 answers
  • Consider the following pseudocode. How much time does the code take to execute? Express all answers in terms of the input variab
    15·1 answer
  • To save a file so that it can be opened on most computers, select the ____ option.
    10·2 answers
  • Java code?????
    12·1 answer
  • What are the steps to creating a blank database? Use the drop-down menus to complete them.
    9·1 answer
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
  • Choose the correct term to complete the sentence.
    12·1 answer
  • As a highly flexible structure, __________ can be quickly configured to adapt as required due to changes.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!