Answer:
- public class FindDuplicate{
-
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
-
- int n = 5;
- int arr[] = new int[n];
-
- for(int i=0; i < arr.length; i++){
- int inputNum = input.nextInt();
- if(inputNum >=1 && inputNum <=n) {
- arr[i] = inputNum;
- }
- }
-
- for(int j =0; j < arr.length; j++){
- for(int k = 0; k < arr.length; k++){
- if(j == k){
- continue;
- }else{
- if(arr[j] == arr[k]){
- System.out.println("True");
- return;
- }
- }
- }
- }
- System.out.println("False");
- }
- }
Explanation:
Firstly, create a Scanner object to get user input (Line 4).
Next, create an array with n-size (Line 7) and then create a for-loop to get user repeatedly enter an integer and assign the input value to the array (Line 9 - 14).
Next, create a double layer for-loop to check the each element in the array against the other elements to see if there is any duplication detected and display "True" (Line 21 - 22). If duplication is found the program will display True and terminate the whole program using return (Line 23). The condition set in Line 18 is to ensure the comparison is not between the same element.
If all the elements in the array are unique the if block (Line 21 - 23) won't run and it will proceed to Line 28 to display message "False".
Answer:
Error detection.
Explanation:
Tcp is a transport layer protocol. It is said to be connection oriented because it requires a handshake or established connection between the sender and the receiver.
Once a handshake is made, the segments of the packets are sent across and the connection is closed.
The error detection does not only carry out integrity checks, but allows for sequence numbering from the sender to receiver. If the packets arrives out of order, the sequence numbers are used to arrange them in the correct order.
Answer:
fifthly, if it is an empty box. it disappear completely. sixth the size of a text box changes depending on the length of a text that we type . this is in contrast with a place holder box where changes are made of the font of the text
Explanation:
mark me a brainlist
The answer to this question is the term virtual memory. A virtual memory is a type of memory that uses a secondary memory which is implemented on hardware and software. A virtual memory maps and combines virtual addresses into a physical address inside the computer memory and operating system controls the memory into virtual memory.