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
Can anyone help me out with my photography questions?
Oliga [24]
Verifying, The answer above me is correct
6 0
2 years ago
Which model allows you to make subsystems in parallel?
boyakko [2]
The model is Parallel Distributed Processing Model (PDP) wherein m<span>Memory results from weblike connections among interacting processing units operating simultaneously, rather than sequentially ( also known as the connectionist model).</span>
8 0
3 years ago
write a java program using a do while loop to prompt the user to enter a password. The user should be prompted to enter the pass
Alex787 [66]
We can import Scanner from Java.utils.Scanner to pull in text entered in the console.

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String password = "";
do {
System.out.print("Enter your password: ");
password = sc.nextLine();
if(!password.equals("pals") {
System.out.println(\nIncorrect Password. Try again.");
}
} while(!password.equals("pals");
3 0
3 years ago
A(n) __________ DHCPv6 server relies on router advertisements to give some information to individual hosts, making small changes
vodomira [7]

Answer:

Stateless

Explanation:

According to my experience in the field of information technology and networking, I can say that the type of server being mentioned is a Stateless DHCPv6 server. This is a server that provides some information to individual hosts within the network, but does not make any address assignments to the individual devices. Like mentioned in the question.

8 0
3 years ago
Write a question that the database will understand. Which records do not contain "sold"?
astraxan [27]

Answer:

b

Explanation:

b

4 0
2 years ago
Other questions:
  • You should use html elements instead of server controls when
    11·1 answer
  • In real-world environments, risks and their direct consequences will most likely span across several domains. However, in the la
    12·1 answer
  • Which one is not the future of wireless technology?
    8·1 answer
  • How prevalent is licensing for software engineers in the United States
    5·1 answer
  • When should you save your document?
    15·2 answers
  • Modify class Time2 of fig 8.5, (which is split into four pictures) to include a tick method that increments the time stored in a
    8·1 answer
  • Please choose the correct option please tell fast​
    9·1 answer
  • Create an application that determines the final cost of food items and non-food items, assuming only non-food items are taxed. T
    8·1 answer
  • What is the second step when designing an algorithm?
    12·2 answers
  • What are the characteristics of computer. Explain any one​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!