How to reverse the elements in a Single dimension array and display the output
By: Ganesh Iyer Printer Friendly Format
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]);
}
}
}
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Subscribe to Tutorials
Related Tutorials
Program using concept of byte long short and int in java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java
Archived Comments
1. Also check How to Reverse Array Elements in Java a
View Tutorial By: Amit at 2016-01-20 16:55:45
2. Java Program to Reverse an Arrayprogramduniya.com/
View Tutorial By: programduniya at 2017-04-19 03:51:19