adplus-dvertising
frame-decoration

Question

What is the output of this program?
    class output 
    {
        public static void main(String args[])
        { 
           String s1 = "one";
           String s2 = s1 + " two";
           System.out.println(s2);
        }
    }

a.

one

b.

two

c.

one two

d.

compilation error

Posted under Java Programming

Answer: (c).one two

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?