answer.
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
Nookie1986 [14]
2 years ago
12

Write a program whose input is two integers and whose output is the two integers swapped. Place the values in an array, where x

is position 0 and y is position 1. Ex: If the input is: 3 8 then the output is: 8 3 Your program must define and call a method: public static void swapValues(int[] values)
Computers and Technology
1 answer:
Aliun [14]2 years ago
7 0

Answer:

import java.util.Arrays;

public class swap{

   public static void main(String []args){

       int [] arr = {2,4};

       swapValues(arr);

   }

   public static void swapValues(int[] values){

       int temp;

       System.out.println(Arrays.toString(values));

       temp=values[0];

       values[0]=values[1];

       values[1] =temp;

       System.out.println(Arrays.toString(values));

   }

}

Explanation:

In the program above, we created the method swapValues that receives an array of integers as parameters. in the method definition, we created a temp variable that is used to swapp the element at index 0 and index 1. Java's Arrays.to string method is used to print the array before and after the swap.

You might be interested in
Universal Containers recently rolled out a Lightning Knowledge implementation; however, users are finding unreliable and unrelat
blsea [12.9K]

Answer:

Option B and option C are the correct options.

Explanation:

When they have arisen an execution the following Knowledge related to the Lightning then, the users will find incredible and that Knowledge which is not related to the Articles for showing on the Salesforce Console's Knowledge One widget.

So, the following actions that are recommended to the consultant for checking the lack of quality are.

  • Firstly, they have to activate and customize wildcards to scan for objects.
  • Then, Establish an intuitive hierarchy for the Data Category.
7 0
2 years ago
1. PLCs were originally designed as replacements for: a) microcomputers. c) analog controllers. b) relay control panels. d) digi
timama [110]

Answer:

PLCs (Programmable logic controller) were original designed as replacement for relay control panels.  Relay is another word for a switch. Relay control panels were made for the control of electronic instrumentents or devices. Later on PLCs were made to replace these timers and relay control panels. PLCs are more reliable, flexible and can work better in the harsh environmental situations then the relay control panels.

3 0
2 years ago
​<br><br> Access from and output to the register is slow true false​
Nataly_w [17]

Answer:

false

Explanation:

it depends most of time so false

4 0
2 years ago
An Internet user has a need to send private data to another user. Which of the following provides the most security when transmi
vazorg [7]

Answer:

C. Sending the data using public-key encryption

Explanation:

Encryption is the only choice that provides security.

4 0
2 years ago
Read 2 more answers
Which of the following best describes open-source web browsers?
podryga [215]
Hello, Good Works mate!

Answer: A) <span>Open-source web browsers allow non-paid access and distribution.

Kind Regards.</span>
4 0
2 years ago
Read 2 more answers
Other questions:
  • Color of seagrass beds on navigational charts? Please quickly
    12·1 answer
  • Which of the following are recommended techniques for protecting computer files and data? Check all of the boxes that apply.
    15·2 answers
  • "use the ______ element to create logical areas on a web page that are embedded within paragraphs or other block formatting elem
    15·1 answer
  • Software code is tested, debugged, fixed, verified, and then:
    11·1 answer
  • Why would someone need to use tools like IECacheView or MyLastSearch on a system? Do companies have the right to search a workst
    11·1 answer
  • Create the strAnalysis() function that takes 1 string argument and returns a string message. The message will be an analysis of
    15·1 answer
  • How many solutions exist for the given equation?
    9·1 answer
  • Interactive media professionals are unique among other Information Technology professionals because they have very good job pros
    6·1 answer
  • 4.2 Code Practice: Question 2
    12·2 answers
  • You are a high school student learning about computers and how to build them. As a class project, you have built a new computer.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!