Programming Tutorials

(追記) (追記ここまで)

How to reverse the elements in a Single dimension array and display the output

By: Ganesh Iyer in Java Tutorials on 2009年05月29日 [フレーム]

This sample Java code shows How to reverse the elements in a Single dimension array and display the output.
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]);
 }
 }
}



(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /