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
nalin [4]
3 years ago
12

What is the output of the following code? ArrayList list = new ArrayList(); java.util.Date d = new java.util.Date(); list.add(d)

; list.add(d); System.out.println((list.get(0) == list.get(1)) + " " + (list.get(0)).equals(list.get(1)));
Computers and Technology
1 answer:
harina [27]3 years ago
8 0

Answer:

true true

Explanation:

The code snippet first declare an arraylist called list. Then, a date object d is created. The object d is added to the arraylist twice.

Then inside the display statement, there are two boolean expressions. They both check if the element in index 0 and index 1 of the arraylist are the same and if they refer to the same object location in the memory.

The object in index 0 and index 1 are the same and they refer to the same object location in the memory hence the output is true true.

You might be interested in
A malware which acts like a spy in computer system is called ___?​
Leona [35]

Answer:

A Trojan horse, or Trojan

6 0
3 years ago
Read 2 more answers
Which is NOT a reason to study science?
VMariaS [17]
Hi!

Science is a way of thinking about the natural world. It asks thought provoking questions and investigates deep into the human mind, our Earth, our periodic table, or our cosmos.

It's a vast field, with a myriad of career options. Scientists want to learn more about how our natural world works, and experiment to discover newfound facts about life as we know it.

Not to <em>blow... </em>away... your... expectations... but, in science, we rarely blow up things. If you're interested in seeing explosions, go apply to be a myth buster.

Hopefully, this helps! =)
8 0
4 years ago
Enter the name of your school or work URL and generate report.What score did it receive?
natta225 [31]

Answer:

Harold Washington College. 21.1

4 0
3 years ago
Favorite friends character and why GO!
Masteriza [31]
Rachel Def i really don’t know just cause
7 0
3 years ago
Read 2 more answers
What is you full name ?​
Svetllana [295]

Answer:

Name: Whydoyouneedtoknow

8 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose that we are using PDDL to describe facts and actions in a certain world called JUNGLE. In the JUNGLE world there are 4 p
    7·1 answer
  • If you change the text to bold,you are changing the what?
    9·1 answer
  • This Is My Humor 0w0
    10·1 answer
  • Which model represents any process in general?
    6·1 answer
  • What causes the poles of the electromagnet in an audio speaker to repeatedly switch directions?
    6·2 answers
  • Jason is working on a Microsoft Excel worksheet and he wants to create a Print Preview shortcut. His teacher asks him to access
    9·1 answer
  • Lee has changed the style of his table to make the header row stand out. Next, he wants to center the text in the header row and
    11·2 answers
  • Que papel tuvo la innovación en la propagación de la telefonía móvil?​
    7·1 answer
  • In a school 50% of the students are younger than 10, 1/20 are 10 years old and 1/10 are older than 10 but younger than 12, the r
    7·1 answer
  • 2.Some artists look for ways to extend copyright for longer than the laws normally allow. Why do they do this?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!