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

Can a main method be declared final?

0 Answers  


How will you print number in reverse (descending) order in BST.

0 Answers   GrapeCity,


How is a structure different from array ?

0 Answers   Amdocs,


Hey buddy.. can you please tell me about the use of marker interface? And is there any link between marker interface and factory methods? Thanks in advance.

2 Answers  


What does i ++ mean in Java?

0 Answers  






How big is a gigabyte?

0 Answers  


What is parsing a sentence?

0 Answers  


How is treeset implemented in java?

0 Answers  


Why stringbuffer is faster than string?

0 Answers  


List some oops concepts in java?

0 Answers  


In Java why we write public static void main(String args[]) why not main()?

46 Answers   Aptech, GE Healthcare, Infosys, Microsoft, New Horizon, Practical Viva Questions, TCS, Wipro,


Why can't we override private static methods?

0 Answers  


Categories