...
Research-Aptitude
February 21, 2024
Software-Engineering
February 22, 2024
Research-Aptitude
February 21, 2024
Software-Engineering
February 22, 2024

OOPS

Question 10
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
Correct Answer: D

Leave a Reply

Your email address will not be published. Required fields are marked *