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.

Answer Posted / nagesh

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

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are methods?

717


What is meant by data hiding in java?

803


What are the two types of streams offered by java 8?

663


What is difference between array and vector?

718


What do you understand by access specifiers in Java?

755






Differentiate between a constructor and a method? Can we mark constructors final?

897


How do you create a null object?

722


What is the use of protected in java?

703


What is an interface in java?

753


What is complexity and its types?

687


Explain when noclassdeffounderror will be raised ?

780


What is collection sort in java?

729


Why java strings are immutable in nature?

749


What is the difference between private & public & friendly classes?

738


How do you remove all elements from an arraylist in java?

686