Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers for 'Digite infotech' - 1 question(s) found - Order By Newest | ||||
![]() | ||||
| ||||
Ans. Using String method - new StringBuffer(str).reverse().toString(); Iterative - public static String getReverseString(String str){ StringBuffer strBuffer = new StringBuffer(str.length); for(int counter=str.length -1 ; counter>=0;counter--){ strBuffer.append(str.charAt(counter)); } return strBuffer; } Recursive - public static String getReverseString(String str){ if(str.length <= 1){ return str; } return (getReverseString(str.subString(1)) + str.charAt(0); } | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() or What is the difference between String , StringBuilder and StringBuffer ? | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() a. It should be declared public and static b. it should have only 1 argument of type String array c. We can override main method d. We can overload main method | ||||