adplus-dvertising
frame-decoration

Question

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”;
       }
}

a.

dogood : dogoodgood

b.

dogood : gooddogood

c.

dogood : dodogood

d.

dogood : dogood

Answer: (d).dogood : dogood

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 the following JAVA program?

Similar Questions

Discover Related MCQs

Q. What is the full form of WWW?

Q. What is the full form of Email?

Q. What is the full form of FTP?

Q. What is the full form of LAN?

Q. ISP is an acronym of

Q. Which of the following layers of the TCP/IP references model routes packets?

Q. Networks of computers connected over greater distances are called

Q. Which of the following is not a layer in the TCP/IP reference model?

Q. How many bits are their in an IP address?

Q. Rules contained in programs on router computers that determine the best path on which to send packets are called

Q. What is the top-level domain in www.yahoo.com/sports

Q. Which of the following protocols is used to send and receive emails?

Q. Which of the following protocols is used to transfer files over a network?

Q. Which of the following is a transport layer protocol in the TCP/IP protocol suite?

Q. Which of the following is used to retrieve mails from remote mail server?

Q. Which of the following application layer protocols uses UDP as its underlying transport protocol?

Q. A web server is a

Q. Which of the following statements is used by the serve to listen for a connection request from a client?

Q. Which of the following is used by a client to establish a socket connection with the server?

Q. What happens when a serve uses a port to blind an object, but the port is not available?