...
Question 2892 – Research Aptitude
February 21, 2024
Question 105 – Software-Engineering
February 22, 2024
Question 2892 – Research Aptitude
February 21, 2024
Question 105 – Software-Engineering
February 22, 2024

Question 6365 – OOPS

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

Correct Answer: D

A
dogood : dogoodgood
B
dogood : gooddogood
C
dogood : dodogood
D
dogood : dogood
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!