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
slava [35]
3 years ago
8

What is the output of the following code? import java.util\.\*; public class Test { public static void main(String[] args) { Lis

t list1 = new ArrayList<>(); list1.add("Atlanta"); list1.add("Macon"); list1.add("Savanna"); List list2 = new ArrayList<>(); list2.add("Atlanta"); list2.add("Macon"); list2.add("Savanna"); List list3 = new ArrayList<>(); list3.add("Macon"); list3.add("Savanna"); list3.add("Atlanta"); System.out.println(list1.equals(list2) + " " + list1.equals(list3)); } }
Computers and Technology
1 answer:
beks73 [17]3 years ago
6 0

Answer:

true false

Explanation:

list1 is assigned as Atlanta, Macon, Savanna

list2 is assigned as Atlanta, Macon, Savanna

list3 is assigned as Macon, Atlanta, Savanna

After these assignments,

The program checks if lis1 is equal to list2 and prints the result. Since both lists are equal, it will print true

The program checks if lis1 is equal to list3 and prints the result. Even though both lists contain the same elements, the order is different, it will print false.

You might be interested in
Most email clients contain a ____ that allows the user to read an email message without actually opening it
Stolb23 [73]
Most email clients contain a "subject" that allows the user to read an email message without actually opening it.
4 0
3 years ago
Read 2 more answers
Write a program that reads in an array of type int . you may assume that there are fewer than 50 entries in the array. your prog
Alla [95]
This may be a difficult thing to do so for anyone to ACTUALLY answer this you migghttt want to up the amount of points you get for answering maybe, 20-40 points.
7 0
3 years ago
Filtering is a function of _____.
Levart [38]
The answer is: switches.

Explanation:

Filtering is a function of switches.
3 0
2 years ago
A blood bank maintains two tables - DONOR, with information about people who are willing to donate blood and ACCEPTOR, with info
Kipish [7]

Answer:

The sql query is given below.

Since we need to count of males and females for a particular blood group, we put xxx for the blood group.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors,

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

Explanation:

The clauses in the query are as follows.

1. SELECT: all the columns required in the output are put in this clause.

2. FROM JOIN ON: the table(s) from which the above columns are taken are put in this clause.

3. WHERE: any condition required to filter the output is put in this clause.

The query is explained below.

1. Find the number of male donors. Number of anything can be found using COUNT() function. A query is required since gender is included in deciding the type of donor.

2. The query is defined to find number of male donors as follows.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "M%"; )

3. In the previous query, LIKE operator is used since it is not defined what value is stored for male donors.

4. Similarly, the query to find the number of female donors is formed.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "F%"; )

5. Next, the final query is formed as follows.

SELECT: both COUNT() functions will come here.

FROM: table name

WHERE: specific blood group will be put here

GROUP BY: this clause is optional and is not used in this query.

HAVING: this clause is optional and is not used in this query.

6. The query after putting all clauses is shown below.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%"),

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%")

FROM DONOR

WHERE BG = xxx;

7. Alias is used in the above query for each column to get the final query.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors, COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

7 0
3 years ago
What Hulu shows should I watch? Actually answer tho.
Alina [70]
Mmmmmmm Utopia falls
3 0
3 years ago
Read 2 more answers
Other questions:
  • Which topology enables only one person, at one time, to send data to others on the network?
    6·1 answer
  • Write a program that prompts the user for a measurement inmeters and then converts it into miles, feet, and inches.
    9·1 answer
  • Place the steps in order to keep a graphic from spilling over into the next page and to include the text it is assciated with.
    12·1 answer
  • Provide the instruction type, assembly language instruction, and binary representation of instruction described by the following
    7·1 answer
  • ________________is a distribution of Linux Operating<br>system for desktop computers.<br>​
    15·1 answer
  • I keep getting this error: postfix.cpp: In function ‘double RPN_evaluation(std::string)’: postfix.cpp:42:26: error: cannot conve
    7·1 answer
  • What is a trojan horse
    8·2 answers
  • Kaitlin likes a particular design theme, but she is not sure about every single color for bullets, backgrounds, etc. found in th
    7·1 answer
  • TO Cloud
    10·1 answer
  • a cloud access security broker (casb) provides protection across 4 areas/pillars: visibility to detect all cloud services, data
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!