string reverse in java
Java
String str = "Hello";
String reverse(String str){
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.reverse();
return sb.toString();
}// Java program to ReverseString using StringBuilder
import java.lang.*;
import java.io.*;
import java.util.*;
// Class of ReverseString
class ReverseString
{
public static void main(String[] args)
{
String input = "Geeks for Geeks";
StringBuilder input1 = new StringBuilder();
// append a string into StringBuilder input1
input1.append(input);
// reverse StringBuilder input1
input1 = input1.reverse();
// print reversed String
System.out.println(input1);
}
}
public class ReverseString {
public static void main(String[] args) {
String s1 = "neelendra";
for(int i=s1.length()-1;i>=0;i--)
{
System.out.print(s1.charAt(i));
}
}
}
Also in Java:
- Title
- what is static setter and getter examples in java
- Category
- Java
- Title
- get long from date java
- Category
- Java
- Title
- convert hashset to array
- Category
- Java
- Title
- how to take input in java
- Category
- Java
- Title
- java 8 printstacktrace in system.out
- Category
- Java
- Title
- sdkmanager JAVA_HOME invalid directory
- Category
- Java
- Title
- java classes and methods simple logic with comments
- Category
- Java
- Title
- applicationcontext.xml
- Category
- Java
- Title
- java hahmap
- Category
- Java
- Title
- how to run java program in linux server
- Category
- Java
- Title
- processing sound library
- Category
- Java
- Title
- java regex replace all characters before
- Category
- Java
- Title
- prime factorization java
- Category
- Java
- Title
- jframe border
- Category
- Java
- Title
- gradle require java version
- Category
- Java
- Title
- null pointer exception java
- Category
- Java
- Title
- javafx action event enter key
- Category
- Java
- Title
- java optional to collection
- Category
- Java
- Title
- java newinstance alternative
- Category
- Java
- Title
- change number into array in java
- Category
- Java
- Title
- color from hex code flutter
- Category
- Java
- Title
- get value textfield java
- Category
- Java
- Title
- java split into arraylist
- Category
- Java
- Title
- try block in java
- Category
- Java
- Title
- java stack pop
- Category
- Java
- Title
- java create folder
- Category
- Java
- Title
- same method name with different arguments
- Category
- Java
- Title
- how to remove all whitespace from string java
- Category
- Java
- Title
- convert date to calendar java
- Category
- Java
- Title
- random java
- Category
- Java
- Title
- iterate through hashtable java
- Category
- Java
- Title
- install java debian 8
- Category
- Java
- Title
- read a file in java and store as integer array using buffered reader
- Category
- Java
- Title
- shorthand if java without else
- Category
- Java
- Title
- Java.awt graphics tutorial
- Category
- Java
- Title
- android round double to 2 decimal
- Category
- Java
- Title
- processing audio android
- Category
- Java
- Title
- java rest client response json
- Category
- Java
- Title
- how to crate a list in java script
- Category
- Java
- Title
- system.arraycopy java
- Category
- Java
- Title
- java replace all xml decoding
- Category
- Java
- Title
- how to open a text file in java
- Category
- Java
- Title
- set java
- Category
- Java
- Title
- caesar cipher java
- Category
- Java
- Title
- how to stop a void java
- Category
- Java
- Title
- hashmap get value by key java
- Category
- Java
- Title
- java loop hashmap
- Category
- Java
- Title
- find duplicate elements in array in java
- Category
- Java
- Title
- how to use spring in java
- Category
- Java
- Title
- java get command line input
- Category
- Java
- Title
- how to make one java class inherit from another
- Category
- Java
- Title
- java creare costante
- Category
- Java
- Title
- 2d arrays | java
- Category
- Java
- Title
- how to get the screen dimensions in java
- Category
- Java
- Title
- create notification android
- Category
- Java
- Title
- reading in lines from a file java
- Category
- Java
- Title
- how to add a number to an array in java
- Category
- Java
- Title
- java check if string is number
- Category
- Java
- Title
- room insert and return id
- Category
- Java
- Title
- java - get open ports
- Category
- Java
- Title
- using class in java
- Category
- Java
- Title
- how to import a scanner in java
- Category
- Java
- Title
- java list get first element
- Category
- Java
- Title
- expression régulière téléphone java
- Category
- Java
- Title
- how to create a list in java
- Category
- Java
- Title
- how to compare strings java
- Category
- Java
- Title
- java set to list
- Category
- Java
- Title
- count number of matches in two strings java
- Category
- Java
- Title
- how to remove all items from alist in java
- Category
- Java
- Title
- java constructor genertic
- Category
- Java
- Title
- convert string to mayus java
- Category
- Java
- Title
- como saber de que tipo es una variable en java
- Category
- Java
- Title
- byte java
- Category
- Java
- Title
- java vs javascript
- Category
- Java
- Title
- Java array hashcode
- Category
- Java
- Title
- run java classpath command line
- Category
- Java
- Title
- how to create a constructor in java
- Category
- Java
- Title
- Java system load from resources
- Category
- Java
- Title
- for loop in java stack overflow
- Category
- Java
- Title
- java list of a class has a string that is equal to
- Category
- Java
- Title
- output statement java
- Category
- Java
- Title
- how to check if the file has remaining without reading from it java
- Category
- Java
- Title
- how to add all list elements at once in java
- Category
- Java
- Title
- json request body not getting parsed by spring boot controller
- Category
- Java
- Title
- java switch case
- Category
- Java
- Title
- java script find screen size of device
- Category
- Java
- Title
- how to create a Rectangle in java
- Category
- Java
- Title
- spigot run command as console
- Category
- Java
- Title
- java stream collect to string
- Category
- Java
- Title
- instantiate optinal java 8
- Category
- Java
- Title
- arraylist with values java
- Category
- Java
- Title
- all data types in java
- Category
- Java
- Title
- how to delete an element from an array in java
- Category
- Java
- Title
- Java sort Map by values
- Category
- Java
- Title
- java try catch
- Category
- Java
- Title
- system.out.println shortcut
- Category
- Java
- Title
- iterator loop java
- Category
- Java
- Title
- how to count the number of occurrences of an element in a arraylist in java
- Category
- Java
- Title
- convert java list to array
- Category
- Java
- Title
- Java array equals
- Category
- Java