package logics;
public class stringReverseIteration {
public static void main(String []a)
{
String name="shashi kumar";
reverse(name);
}
public static void reverse(String data)
{
for(int i=data.length()-1;i>=0;i--)
{
System.out.print(data.charAt(i));
}
}
}//class
output
--------------------
ramuk ihsahs
public class stringReverseIteration {
public static void main(String []a)
{
String name="shashi kumar";
reverse(name);
}
public static void reverse(String data)
{
for(int i=data.length()-1;i>=0;i--)
{
System.out.print(data.charAt(i));
}
}
}//class
output
--------------------
ramuk ihsahs
Không có nhận xét nào:
Đăng nhận xét