Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
StringBuffer
:
Content language: English
Русский
What will be the result of compiling and running the following program? public class App1 { public static void main(String[] args) { System.out.println(addToString("12345678910",',')); } public static StringBuffer addToString(String s, char c) { StringBuffer b = new StringBuffer(s); int p = 0; for (int i = 1; i < b.length(); i++) { if (i%3 == 0) { b.insert(b.length()-i-p, c); p++; } } return b; } }
StringBuffer
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes