1,559 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

Please log in or register to answer this question.

Related questions

2 votes
2 votes
2 answers
2
Roma_nagpal asked Jun 28, 2018
2,474 views
A signal processor software is expected to operate for 91.25 days after repair, and the mean software repair time is expected to be 5 minutes. Then, the availability of t...
0 votes
0 votes
1 answer
4