Sponsor

banner image

recent posts

Write a Java Program to reverse a string without using String inbuilt function.

Here, we are initializing a string variable str and are making use of the string builder class

1public class FinalReverseWithoutUsingStringMethods {
2 
3          public static void main(String[] args) {
4                   // TODO Auto-generated method stub
5                   String str = "Automation";
6                   StringBuilder str2 = new StringBuilder();
7                   str2.append(str);
8                   str2 = str2.reverse();     // used string builder to reverse
9                   System.out.println(str2);
10          }
11 
12}
Output:
noitamotuA
Write a Java Program to reverse a string without using String inbuilt function. Write a Java Program to reverse a string without using String inbuilt function. Reviewed by D kumar on September 19, 2019 Rating: 5

Search

My Blog List

My Blog List

Hey guy's follow us on blog & social media( fb, insta,twitter, linkedin...) to get notifications about latest updates.

Followers

Powered by Blogger.