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.
Answer:
When discussing the data-modeling building blocks, anything (a person, a place, a thing, or an event) about which data are to be collected and stored is referred to as an entity.
Explanation:
Entities, attributes, and relationships are the basic building blocks of all data models .
An entity is therefore described as anything, such as a person, place, thing, or event, about which data are to be collected and stored. They may be physical objects such as customers or products.
Answer:
It helps you understand stuff faster
Explanation:
There are many peripheral devices but heres 4 external output ones: monitor, speakers, plotter, and printer. Here are also 4 peripheral input devices: mouse, keyboard, mousepad, and joystick.