Linked Questions

85 questions linked to/from Reverse a string in Java
-2 votes
1 answer
16k views

I just want to reverse a inputted String by using for loop. I have tried the following code below. [ its full of mistake i think.. cause i dont know how to convert things to array or to string in ...
2 votes
3 answers
6k views

I recently attended an interview where I was asked to write a program. The problem was: Take a string. "Hammer", for example. Reverse it and any character should not be repeated. So, the output ...
leo11's user avatar
  • 85
1 vote
3 answers
2k views

What's the fastest way to reverse a Long value? For example, 9876543210 should return 0123456789. This is what I have right now: long n = 0, c = 987654321 * 10; // *10 is to get 9876543210 as long ...
-1 votes
4 answers
2k views

Like to know how to reverse a string value (1 word) which is pre-declared in the program. I mean not using user input or scanner. Like to reverse a word "TRAIN" which is pre-declared in the program. ...
badri's user avatar
  • 31
1 vote
3 answers
1k views

I'm trying to make a code that reverse's a string, I know there are more easy ways to do this but I just wanted to know why this code does not work: public class Reverse { /** * Prints a ...
user avatar
-4 votes
1 answer
1k views

Suppose there is a string variable str = "A man is no one!", then i need the reverse of this string to be stored in same str variable as "!eno on si nam A", without using any other object or variable....
-2 votes
1 answer
827 views

I am trying to reverse user input string my code below is working so that it just output as same as input value.. For example "Hello" will come out "Hello" while result should be "olleH" This is my ...
DPabst's user avatar
  • 35
-2 votes
3 answers
176 views

I can't get my function to return the reversed string. I keep getting the original string, plus the reversed sting attached together. P.S this is obviously a question from someone new. Cut me some ...
JWL1988's user avatar
-5 votes
2 answers
196 views

Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, you must do this by modifying the input array in-...
TIGUZI's user avatar
  • 241
1 vote
1 answer
337 views

I am just a beginner and do not know how to reverse text that I write on input so it is reversed on output. I wrote something like this: public static void main(String[] args) { Scanner sc = ...
Ales 's user avatar
  • 11
0 votes
1 answer
228 views

So basically I want to do the following: String s1 = "hello"; for(int count = s1.length() -1; count >= 0; count--){ System.out.printf("%c, ", s1.charAt(count)); } but do that in ...
0 votes
3 answers
103 views

How do i make an array with the opposite letters of the first array im making? For example if the string is "Hello", i want to use arrays to print out "olleH". When i try to return the variables it ...
Lotun Kanji's user avatar
0 votes
1 answer
117 views

Scanner sc = new Scanner(System.in); System.out.print("Enter the number to reverse "); String mystring = sc.nextLine(); char[] my_3 = mystring.toCharArray(); // string converted ...
0 votes
0 answers
97 views

if i need to reverse a given string like " HELLO WORLD " to become "DLROW OLLEH " so how can do that ? and if there is any function that do the same what is it ?
Bro's user avatar
  • 1
-3 votes
2 answers
94 views

Trying to reverse the string input. Eg: input- hello friend output- dneirf olleh Here is the program I made but it shows string index out of range as error: import java.io.*; class ...
Pranjal's user avatar

15 30 50 per page
1
2 3 4 5 6