Telegram Group & Telegram Channel
🤔Вопрос-ответ. Как перевернуть строку в Java?

👩‍💻Один из вариантов решения:
public class StringPrograms {
public static void main(String[] args) {
String str = "123";
System.out.println(reverse(str));
}

public static String reverse(String in) {
if (in == null)
throw new IllegalArgumentException("Null is not valid input");
StringBuilder out = new StringBuilder();
char[] chars = in.toCharArray();
for (int i = chars.length - 1; i >= 0; i--)
out.append(chars[i]);
return out.toString();
}

}


#собеседование
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/javarocks/232
Create:
Last Update:

🤔Вопрос-ответ. Как перевернуть строку в Java?

👩‍💻Один из вариантов решения:

public class StringPrograms {
public static void main(String[] args) {
String str = "123";
System.out.println(reverse(str));
}

public static String reverse(String in) {
if (in == null)
throw new IllegalArgumentException("Null is not valid input");
StringBuilder out = new StringBuilder();
char[] chars = in.toCharArray();
for (int i = chars.length - 1; i >= 0; i--)
out.append(chars[i]);
return out.toString();
}

}


#собеседование

BY JavaRocks


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/javarocks/232

View MORE
Open in Telegram


JavaRocks Telegram | DID YOU KNOW?

Date: |

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

Telegram is riding high, adding tens of million of users this year. Now the bill is coming due.Telegram is one of the few significant social-media challengers to Facebook Inc., FB -1.90% on a trajectory toward one billion users active each month by the end of 2022, up from roughly 550 million today.

JavaRocks from ua


Telegram JavaRocks
FROM USA