class reversArray
{
public static void main(String[] args)
{
int i;
String[] s = new String[4];
s[0]=\"My\";
s[1]=\"Leg\";
s[2]=\"is\";
s[3]=\"cut\";
for(i=s.length-1; i>=0; i--)
{
System.out.println(\"String reverse \"+s[i]);
}
}
}
Java / PRACTICAL TUTORIAL
How to reverse the elements in a Single dimension array and display the output
Advertisement
This sample Java code shows How to reverse the elements in a Single dimension array and display the output.
From the community
No archived comments on this tutorial.