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 = obj;
            obj2 = " world";
            System.out.println(obj + " " + obj2);
        }
    }

a.

hello hello

b.

world world

c.

hello world

d.

world hello

Posted under Java Programming

Answer: (c).hello world

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?