Answer:
- import java.util.ArrayList;
- public class Main {
-
- public static void main(String[] args) {
- ArrayList<String> strList =new ArrayList<String>();
- strList.add("to");
- strList.add("be");
- strList.add("or");
- strList.add("not");
- strList.add("to");
- strList.add("be");
- strList.add("hamlet");
-
- swapPairs(strList);
- System.out.println(strList);
- }
-
- public static void swapPairs(ArrayList<String> list){
- for(int i=0; i < list.size()-1; i+=2){
- String temp = list.get(i);
- list.set(i, list.get(i+1));
- list.set(i+1, temp);
- }
- }
- }
Explanation:
Firstly, let's create a method swapPairs that take one ArrayList (Line 18). In the method, use a for-loop to traverse through each item in the ArrayList and swap the items between the current items at index-i and at index-i+1 (Line 19-22). The index-i is incremented by two in next loop and therefore the next swapping will proceed with third and fourth items and so forth.
In the main program, create a sample ArrayList (Line 5-12) and then test the method (Line 14) and print the output (Line 15). We shall get [be, to, not, or, be, to, hamlet].
Answer:
2. testing cybersquatting
Explanation:
Phishing is the fraudulent attempt to obtain sensitive information such as usernames, passwords and credit card details by disguising oneself as a trustworthy entity in an electronic communication. In this case, phishing domain refer to a domain that is not a trustworthy one but try to deceive user into using it in place of the genuine domain.
Cybersquatting also known as domain squatting is registering, selling or using a domain name with the intent of profiting from the goodwill of someone else's trademark. It generally refers to the practice of buying up domain names that use the names of existing businesses with the intent to sell the names for a profit to those businesses.
Identity theft is the illegal use of someone else's personal information in order to obtain money or credit. It is the deliberate use of someone else's identity, usually as a method to gain a financial advantage or obtain credit and other benefits in the other person's name, and perhaps to the other person's disadvantage or loss.
From the above definition, it is seen that someone registering a domain name that is a company's trademark, hoping to resell it to the company at an exorbitant profit is called testing cybersquatting.
The best and most correct answer among the choices provided by your question is the third choice or letter C. A bar graph resembles histogram the most.
A histogram<span> is a graphical representation of the distribution of numerical data. It is an estimate of the probability distribution of a continuous variable (quantitative variable) and was first introduced by Karl Pearson.
</span>
I hope my answer has come to your help. Thank you for posting your question here in Brainly.
Closeup? I think I’m pretty sure but I don’t really know though