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
Create a view named product_summary. This view should return summary information about each product. Each row should include pro
RUDIKE [14]

Answer:

CREATE VIEW [product_summary] AS

SELECT product_id , order_count , order_total FROM Product;

SELECT *  FROM [product_summary] ;

Explanation:

  • First of all, use the CREATE VIEW syntax to create a view named product_summary that includes the product_id, order_count, order_total columns and returns the summary information about each product.
  • Use SELECT statement to return all the columns from the product_summary view.
5 0
4 years ago
________ are websites that provide collections of content from all over the world wide web a. aggregators b. social networks c.
marta [7]
The answer would be a.) aggregators
5 0
3 years ago
What is the term for the era created by the digital revolution?<br>​
puteri [66]

Answer:

The Digital Revolution also marks the beginning of the Information Era. The Digital Revolution is sometimes also called the Third Industrial Revolution.

Explanation:

Hope this Helps.

5 0
3 years ago
This might sound crazy! But please help.
aliya0001 [1]

Answer:

You Probably should’nt do that

Explanation:

8 0
2 years ago
Analyze the following code:
olganol [36]

Answer:

The program displays 5 4 3 2 1 and then raises an Array Index Out Of Bounds Exception.

Explanation:

A sample of code output is attached.

The code snippet contain xMethod that takes an array and array length as argument.

In the given snippet, the array {1, 2, 3, 4, 5} and length (5) is passed as argument to the method.

First the method display the element of the array in reverse order

System.out.print(" " + x[length - 1]);

and then the method call itself again. This displays

5 from x[4]

4 from x[3]

3 from x[2]

2 from x[1]

1 from x[0]

but after displaying 1, when it tries to call the method again, an array index out of bound exception is thrown because it will try accessing an element from the array when it is already exhausted.

5 0
3 years ago
Other questions:
  • If a security officer is non-commissioned officer, he can carry a baton on duty if he went through a training class
    8·1 answer
  • The part of the computer that provides access to the internet is the?
    14·1 answer
  • Mobile apps known as news _________ collect articles from a variety of sources and present them to you in a magazine-style forma
    7·2 answers
  • Write syntactically correct Javascript code to sort an array of sub-arrays containing integers using the sort and reduce array f
    11·1 answer
  • Create a pseudocode program that asks students to enter a word. Call a function to compute the different ways in which the lette
    9·1 answer
  • What do we call data that's broken down into bits and sent through a network?
    15·1 answer
  • In our discussion of Computer Hardware, we talked about three essential hardware components that are there inside every computer
    14·1 answer
  • Lets say if my computer shut down every 10 minutes. What can you do to solve the problem. Hint: Use these word in you answer: ha
    10·2 answers
  • 1. select the correct answer from the given options.
    5·1 answer
  • Which sentence is correctly punctuated? WILL GIVE YU MONEY GIVE ME YOUR CASH APP PLS
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!