Java: How to reverse a number of strings using “import.java.util.*;” that is User Dependent? [closed]?

Up vote -1 down vote favorite 1 share g+ share fb share tw.

I already had a program.. but the only thing I want to add is reverse it.. I used one class.. and one is the main class.. main class: public maonajudni() { } public static void main(String args) { Scanner in = new Scanner(System. In); System.out. Println("Enter how many stringz"); int x = in.nextInt(); String applearray = new Stringx; for(int I = 0 ; I Sortme(applearray , x); gstonako.

Uppervowel(applearray , x); } } this is the class: class nospance { public static void main(String args) { } public void sortme(String s , int y){ String tmp=""; for(int j = 0 ; j Println(""); for(int k = 0 ; k CharAt(k); System.out. Print(""+tmp.toUpperCase()); tmp = ""; } else if(arrj. CharAt(k)=='E' || arrj.

CharAt(k)=='e'){ tmp = tmp + arrj. CharAt(k); System.out. Print(""+tmp.toUpperCase()); tmp = ""; } else if(arrj.

CharAt(k)=='I' || arrj. CharAt(k)=='i'){ tmp = tmp + arrj. CharAt(k); System.out.

Print(""+tmp.toUpperCase()); tmp = ""; } else if(arrj. CharAt(k)=='O' || arrj. CharAt(k)=='o'){ tmp = tmp + arrj.

CharAt(k); System.out. Print(""+tmp.toUpperCase()); tmp = ""; } else if(arrj. CharAt(k)=='U' || arrj.

CharAt(k)=='u'){ tmp = tmp + arrj. CharAt(k); System.out. Print(""+tmp.toUpperCase()); tmp = ""; } else{ System.out.

Print(""+ arrj. CharAt(k)); } } } } } this is already a running program. Can someone help me add reverse the inputted strings?

Please and thank you. I used JCreator Pro and jdk 1.7.0. Java string user-input reverse link|improve this question asked Jan 28 at 22:12user11757811.

Why not use StringBuilder.reverse() to reverse a string. – RanRag Jan 28 at 22:23.

You can use standart Java libraries String str = "abcd"; StringBuilder sb = new StringBuilder(str); System.out. Println(sb.reverse()); or you can write your own function private static String reverse(String s) { StringBuilder result = new StringBuilder(); for (int I = s.length(); I > 0; --i) { result. Append(s.

CharAt(i - 1)); } return result.toString(); }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions