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 35 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
Wow, this really help


FergA

  • Member
  • Posts: 352
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

The B-complex vitamins and vitamin C are not stored in the body and must be replaced each day.

Did you know?

Not getting enough sleep can greatly weaken the immune system. Lack of sleep makes you more likely to catch a cold, or more difficult to fight off an infection.

Did you know?

Recent studies have shown that the number of medication errors increases in relation to the number of orders that are verified per pharmacist, per work shift.

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?

Limit intake of red meat and dairy products made with whole milk. Choose skim milk, low-fat or fat-free dairy products. Limit fried food. Use healthy oils when cooking.

For a complete list of videos, visit our video library