Hai all
I want to print given array in reverse order Ex:
int a[]={1,2,3,4,5};display this array in reverse order.

Answers were Sorted based on User's Feedback



Hai all I want to print given array in reverse order Ex: int a[]={1,2,3,4,5};display this array in..

Answer / nagesh

for(int i=a.length-1;i>=0;i--){
System.out.println(a[i])
}

Is This Answer Correct ?    9 Yes 1 No

Hai all I want to print given array in reverse order Ex: int a[]={1,2,3,4,5};display this array in..

Answer / anandkumar

hai kumar you r wrong
with use of loop only we can reverse...
we can't do it with reverse() method b'coz this is not String Type....

Is This Answer Correct ?    2 Yes 0 No

Hai all I want to print given array in reverse order Ex: int a[]={1,2,3,4,5};display this array in..

Answer / kumar

Either you can use the for loop or reverse() method to
display the results in reverse order.

Is This Answer Correct ?    1 Yes 2 No

Hai all I want to print given array in reverse order Ex: int a[]={1,2,3,4,5};display this array in..

Answer / guest

5
4
3
2
1

Is This Answer Correct ?    0 Yes 9 No

Post New Answer

More Core Java Interview Questions

How large is a boolean?

0 Answers  


i need to know the site which compiles and run the java program completely in online... thank you for your reply in advance

2 Answers  


How to deprecate a method? Show it with proper example. Plz give the answer of this.Thanx in advance. mail me: tanzeem.akhtar@gmail.com

2 Answers  


How many bytes is a url?

0 Answers  


hi to all. well can you please tell me that why String class is immutable? Thanks in advance.

5 Answers   Huawei,






How a class can implement an interface?

5 Answers   SysArc,


What is output buffer?

0 Answers  


What is the full meaning of java?

0 Answers  


What are virtual methods?

1 Answers   TCS,


Is logger a singleton?

0 Answers  


How do you add an element to an arraylist in java?

0 Answers  


Can we access a database using applets?

2 Answers   Hewitt,


Categories