Question 2892 – Research Aptitude
February 21, 2024Question 105 – Software-Engineering
February 22, 2024Question 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
dogood : dogoodgood
dogood : gooddogood
dogood : dodogood
dogood : dogood
Subscribe
Login
0 Comments