adplus-dvertising
frame-decoration

Question

What is the output of this program?
    class string_class 
    {
        public static void main(String args[])
        {
            String obj = "hello";
            String obj1 = "world";   
            String obj2 = "hello";
            System.out.println(obj.equals(obj1) + " " + obj.equals(obj2));
        }
    }

a.

false false

b.

true true

c.

true false

d.

false true

Posted under Java Programming

Answer: (d).false true

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?