Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Today at 3:05 AM
Power Lifting Lever Belt
SkullVamp
Updated:
Jun 13, 2026
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Jun 13, 2026
Colombo
Kaduwela - Two Storey House for Sale
dilrasan
Updated:
Jun 11, 2026
Ad icon
Wechat qr verification
Pawan2005
Updated:
Jun 11, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Jobs & Employment
Programming interview - written tests
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Anonymous_Abstract" data-source="post: 24789835" data-attributes="member: 568286"><p><span style="font-size: 15px">public static void main(String[] args) {</span></p><p><span style="font-size: 15px"> TestDemo td = new TestDemo();</span></p><p><span style="font-size: 15px"> </span></p><p><span style="font-size: 15px"> String str = "Fuck";</span></p><p><span style="font-size: 15px"> str = td.reverse(str).toString();</span></p><p><span style="font-size: 15px"> System.out.println(str);</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"> </span></p><p><span style="font-size: 15px"> public StringBuffer reverse(String str) throws ArrayIndexOutOfBoundsException</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> </span></p><p><span style="font-size: 15px"> char[] ch = str.toCharArray();//'F','u','c','k'</span></p><p><span style="font-size: 15px"> int len = ch.length;</span></p><p><span style="font-size: 15px"> //char[] ch2=new char[len];</span></p><p><span style="font-size: 15px"> StringBuffer sb = new StringBuffer();</span></p><p><span style="font-size: 15px"> for(int i=len-1;i>=0;i--)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> sb.append(ch<em>);</em></span></p><p><span style="font-size: 15px"><em> }</em></span></p><p><span style="font-size: 15px"><em></em></span></p><p><span style="font-size: 15px"><em> return sb;</em></span></p><p><span style="font-size: 15px"><em> }</em></span></p></blockquote><p></p>
[QUOTE="Anonymous_Abstract, post: 24789835, member: 568286"] [SIZE="4"]public static void main(String[] args) { TestDemo td = new TestDemo(); String str = "Fuck"; str = td.reverse(str).toString(); System.out.println(str); } public StringBuffer reverse(String str) throws ArrayIndexOutOfBoundsException { char[] ch = str.toCharArray();//'F','u','c','k' int len = ch.length; //char[] ch2=new char[len]; StringBuffer sb = new StringBuffer(); for(int i=len-1;i>=0;i--) { sb.append(ch[i]); } return sb; }[/i][/SIZE][i][/i] [/QUOTE]
Insert quotes…
Verification
Nawa warak dahaya keeyada? (Namaya wadi kireema dahaya)
Post reply
Top
Bottom