Either take array element 0 to 4
Or change your logic inside for loop : decrease 1 inside array index
eg. a[a[I] - 1] = ...
like this
More Related Contents:
- Null Pointer Exception in You Tube Analytics API using Java IntelliJ IDEA?
- Sequence in java
- Difference between wait() and sleep()
- How to use Key Bindings instead of Key Listeners
- How to redirect multiple types of users to their respective Activities?
- Why does Java prohibit static fields in inner classes?
- Recommended way to get hostname in Java
- Import Maven dependencies in IntelliJ IDEA
- Why are the RSA-SHA256 signatures I generate with OpenSSL and Java different?
- Enhanced ‘for’ loop causes an ArrayIndexOutOfBoundsException
- Cannot instantiate the type List [duplicate]
- MessageBodyProviderNotFoundException while running jar from command line
- How to change background color of JTabbedPane?
- How to check a timeperiod is overlapping another time period in java
- Sort a List of objects by multiple fields [duplicate]
- Empty an ArrayList or just create a new one and let the old one be garbage collected? [duplicate]
- How to write data to two java.io.OutputStream objects at once?
- Disabling Log4J Output in Java
- Static context cannot access non-static in Collectors
- XML Node to String in Java
- How to initialize MongoClient once in Spring Boot and use its methods?
- Java 8, how can I implement a switch statement using streams?
- Is SecureRandom thread safe?
- spring data jpa @query and pageable
- Javadoc @author tag good practices
- Printing with Attributes(Tray Control, Duplex, etc…) using javax.print library
- How to keep the order of elements in hashtable
- Why subclass in another package cannot access a protected method?
- struts2 file upload loosing parameters
- Unserialize in Java a serialized php object