in Others
1,561 views
0 votes
0 votes
What is the output of the following JAVA program ?

Class Test

{

          public static void main (String [ ] args)

         {

                    Test obj = new Test ( );

                    obj.start ( );

         }

        void start ( )

        {

                   String stra=”do”;

                   String strb = method (stra);

                   System.out.print(“:” + stra + strb);

        }

        String method (String stra)

        {

                    stra=stra+”good”;

                    System.out.print (stra);

                    return “good”;

        }

}

(1)  dogood : dogoodgood

(2)  dogood : gooddogood

(3)  dogood : dodogood

(4)  dogood : dogood
in Others
1.6k views

1 comment

4) dogood : dogood
0
0

Please log in or register to answer this question.

Related questions