This topic contains a solution. Click here to go to the answer

Author Question: What is the output of the following code?public class Test { public static void main(String[] args) ... (Read 26 times)

wrbasek0

  • Hero Member
  • *****
  • Posts: 560

Question 1

What is the output of the following code?

public class Test {
public static void main(String[] args) {
Object o1 = new Object();
Object o2 = new Object();
System.out.print((o1 == o2) + " " + (o1.equals(o2)));
}
}

◦ true false
◦ false false
◦ false true
◦ true true

Question 2

What is the output of the following code?

public class Test {
public static void main(String[] args) {
String s1 = new String("Java");
String s2 = new String("Java");
System.out.print((s1 == s2) + " " + (s1.equals(s2)));
}
}

◦ true true
◦ false true
◦ true false
◦ false false


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by wrbasek0 on May 6, 2020

juwms

  • Sr. Member
  • ****
  • Posts: 337
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




wrbasek0

  • Member
  • Posts: 560
Reply 2 on: May 6, 2020
Thanks for the timely response, appreciate it


connor417

  • Member
  • Posts: 329
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

Cyanide works by making the human body unable to use oxygen.

Did you know?

Sildenafil (Viagra®) has two actions that may be of consequence in patients with heart disease. It can lower the blood pressure, and it can interact with nitrates. It should never be used in patients who are taking nitrates.

Did you know?

Addicts to opiates often avoid treatment because they are afraid of withdrawal. Though unpleasant, with proper management, withdrawal is rarely fatal and passes relatively quickly.

Did you know?

The term bacteria was devised in the 19th century by German biologist Ferdinand Cohn. He based it on the Greek word "bakterion" meaning a small rod or staff. Cohn is considered to be the father of modern bacteriology.

Did you know?

Adults are resistant to the bacterium that causes Botulism. These bacteria thrive in honey – therefore, honey should never be given to infants since their immune systems are not yet resistant.

For a complete list of videos, visit our video library