Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
72 views

I'm working on a road traffic simulation in AnyLogic where a set of vehicles randomly visit multiple stop lines and then proceed to their next destination. However, I'm encountering the following ...
Mohammad Safari's user avatar
0 votes
2 answers
92 views

def change(amount: Int, coins: Array[Int]): Int = { val dp = Array[Int](amount + 1) dp(0) = 1 for { coin <- coins i <- coin to amount } dp(...
anil's user avatar
  • 1
1 vote
1 answer
219 views

My code is simple but causes a weird IndexOutOfBoundsException. It happens only once in ten thousands, but it happens. I can see them only in the Firebase Crashlytics Report. Could you see the problem ...
Youja's user avatar
  • 31
-1 votes
1 answer
780 views

I were working and building successfully each time. Suddenly it's showing this message: Index 2048 out of bounds for length 2048 It shows only when I click to run on AVD. Beside this, during the build ...
Abu Saleh Muhammad Zakaria's user avatar
0 votes
1 answer
54 views

I was solving this question, trying to generate spiral matrix but repeatedly getting error only when the length of the matrix is odd. It is working fine when the length is even This is the code: ...
Debashis Baral's user avatar
0 votes
0 answers
101 views

HERE IS THE JAVA CODE.HAVING ARRAY INDEX OUT OF BOUND ERROR ON RUNTIME. i don't know what to do. I have tried every possible solution for this. This is the error i am getting "Exception in thread ...
Hafsa Izhar's user avatar
-2 votes
2 answers
162 views

I am coding with Java a function that checks if a date it's ok or not and want to jump up of the method if some condition is executed. I've read a similar question but hasn't the same trouble as it ...
DBG's user avatar
  • 1
0 votes
2 answers
708 views

@Keep @Composable @InternalCoroutinesApi @ExperimentalCoroutinesApi fun SetupNavigationHost( navController: NavHostController, ) { NavHost( navController = navController, ...
Sepidehye Fanavari's user avatar
-1 votes
1 answer
46 views

I know there have been other posts about ArrayIndexOutOfBoundsException, but I still can't pinpoint where this exception occurs. I've been working on this beast for entire week now. I am now blind ...
stupidmoron's user avatar
0 votes
0 answers
42 views

When I run the program, the accept method() runs smoothly but when I try to run the display() method, it shows an ArrayIndexOutOfBoundException: Index 0 out of bounds for length 0. I think it is ...
rhucha's user avatar
  • 1
0 votes
1 answer
71 views

I'm trying to do a program which uses a matrix and makes a new one with each element being the sum of every adjacent element of the original one plus itself. It's very easy to understand that the &...
Ignacio Romero's user avatar
-2 votes
1 answer
744 views

I am facing a problem in Merge Sort coded in Java language. Please can you see where I am wrong because I am facing Index out of bounds problem. I am sharing the code. Please check ! The error in the ...
Samik Pandit's user avatar
1 vote
4 answers
158 views

Given the task zeroFront notAlone from CodingBat: Return an array that contains the exact same numbers as the given array, but rearranged so that all the zeros are grouped at the start of the array. ...
Evgeniy's user avatar
  • 140
0 votes
2 answers
2k views

Everyone, hi! Friends, when you click on the button, a new activity does not start. The following exception occurs: java.lang.ArrayIndexOutOfBoundsException. The log of my error is presented below: E/...
MAGistr's user avatar
  • 119
0 votes
0 answers
333 views

C# Coding for unity I have several arrays set as such. public float[] arrayName; no set number of elements anywhere in my code I can access the arrays up to 6 no problems but when I get to 7 I get an ...
Darren's user avatar
  • 3
0 votes
2 answers
724 views

import java.util.*; public class ArrayIndexOutOfBoundsException { public static void main(String[] args) { int[] array = new int[100]; //creating array with 100 storage spaces for(int ...
alyssad5's user avatar
-1 votes
1 answer
190 views

I'm following a tutorial for a two-pointer implementation (solution for 3Sum essentially) and I'm confused about the second while-loop in this search method: private static void searchPair(int[] arr,...
TorusWithSprinkles's user avatar
0 votes
2 answers
150 views

I have a problem regarding index out of bound error in arrays. I want to create a method that takes month and day as parameter and returns day of the year.If any of the parameters are incorrect, the ...
Eric Karaeen's user avatar
0 votes
1 answer
184 views

I am working on a messaging application. The GUI is written in Java Swing. When the client starts, it asks my server for the chats a specific user is involved in. The server will send these in the ...
Gamaray's user avatar
  • 70
0 votes
1 answer
1k views

I'm making a java program for schoolwork where you can add, move and remove stuff from containers. I have to use commands like "add 100" "remove 50". The stop command "lopeta&...
kinkkelaade's user avatar
-3 votes
2 answers
89 views

Can we use enhanced for loop without getting ArrayIndexOutOfBound error. because after using normal for loop it is working. public static void main(String[] args) { int a[] = {1,2,3,4}; ...
Prajakta Yadav's user avatar
0 votes
1 answer
96 views

This program should send a text message from client to the server. i finished compiled the file. the server.java runs successfully but the client.java shows error. the error list is too long so i only ...
YAChee's user avatar
  • 21
0 votes
1 answer
223 views

I need to create a program that takes integer command-line arguments. The first argument would be the count of the remaining arguments that are between 1 and 100 (inclusive of 1 and 100). It then ...
gizmo.java's user avatar
0 votes
1 answer
464 views

My app is a single activity app with different screens represented by composables. I am using navigation component to handle screen navigation. My navigation component has AnimatedNavHost as: ...
Sparsh Dutta's user avatar
  • 3,078
0 votes
1 answer
297 views

Hello? I am debugging some issue related with Android widget. My app is using two thread provided by Glide library to make original widget image file and thumbnail widget image file. When Making a ...
박찬준's user avatar
  • 458
1 vote
1 answer
65 views

this is the QuickSort Randomized that I've come up with, but it constantly throws out IndexOutOfBounds exception. Could I have some help with it? Thanks! import java.util.Random; public class ...
Roo's user avatar
  • 23
0 votes
1 answer
261 views

I'm writing an implementation for AES with 128 bit key. An exception is thrown at the last line of the else block. private static int KEY_SIZE_IN_BYTE = 16; private static int ...
dtgrand's user avatar
0 votes
1 answer
460 views

I'm trying to write the binary search algorithm, But Geeks for Geeks practice problem Binary Search yields following error: Runtime Error: Runtime ErrorException in thread "main" java.lang....
Hax's user avatar
  • 154
0 votes
1 answer
65 views

I'm working on a gameboard that prints out something like this: Here's the code I wrote void showBoard() { String city1, city2, city3, city4, city5, city6, city7, city8, city9, city10; ...
ICIS's user avatar
  • 9
-1 votes
1 answer
227 views

I have all my cells stored in an ArrayList and I want to check how many mines they are surrounded by (mines are cells with a not null mine png). I thought of checking the positions -1, +1, -9, +9, -10,...
Jds Wolf's user avatar
0 votes
2 answers
886 views

I have three java files one is RMI server and RMI client and interface file, as follow: server: import java.rmi.*; import java.rmi.registry.*; import java.rmi.server.*; import java.net.*; public ...
anie's user avatar
  • 531
0 votes
1 answer
808 views

Environment: Jboss 7.2 Primefaces 10 Java 11 I have migrated from primefaces 8 to primefaces 10 dataTable p:dataExporter generate ArrayIndexOutOfBoundsException on render the xhtml. When I comment ...
Joe's user avatar
  • 7,939
1 vote
0 answers
1k views

I am trying to implement dark theme from fragment named as "Fragment_One" in android studio. This is from that fragment file if (!isChecked) { ...
M Baig's user avatar
  • 219
0 votes
2 answers
244 views

One of my school works tells us to make an 2D array, and display what is in the array. I don't know why it is saying out of bounds, and am kind of stuck. What we where tasked to do is to make, 10 ...
okay4's user avatar
  • 13
1 vote
1 answer
292 views

I am trying to convert my code to lambda version and I get java.lang.ArrayIndexOutOfBoundsException: 18 exception when I am building the code. This is the working code: private void run(){ ...
Nu-ONE's user avatar
  • 699
-2 votes
1 answer
569 views

I wanted to ask a question of code that has grated ja, I have the following code, I am going through a 10x5 array to fill it with number 1, to 49 for a primitive and the function that is responsible ...
Alex carrasco's user avatar
0 votes
1 answer
136 views

My textbook showed this piece of C++ code to run however when I run it on net beans it displays this error Exception in thread "main" ArrayIndexOutOfBoundsException: 0 #include <iostream&...
user1234554321's user avatar
0 votes
1 answer
1k views

I have never tested with JUnit, not sure what I have to do in this case @Test(expected = ArrayIndexOutOfBoundsException.class) public void throwsArrayIndexException() { ... } I just have to test ...
UserNumber5's user avatar
0 votes
1 answer
125 views

I'm trying to program a quiz app. My app crashes as soon as I run it in the background and then open it again. I get an ArrayIndexOutOfBoundsException. Unfortunately I cannot see the error although I ...
neverEndingQuestion's user avatar
0 votes
0 answers
477 views

It feels like a bug in the system. How to solve this problem android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600) android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) ...
zhej's user avatar
  • 21
-3 votes
3 answers
263 views

After each loop count and count1 are updated. After giving inputs in Scanner, I'm not getting any output. Scanner sc = new Scanner(System.in); int t = sc.nextInt(); // t=1 while (t != 0) { int n = ...
Mayur Hovale's user avatar
363 votes
25 answers
1.1m views

What does ArrayIndexOutOfBoundsException mean and how do I get rid of it? Here is a code sample that triggers the exception: String[] names = { "tom", "bob", "harry" }; for (int i = 0; i <= ...
Aaron's user avatar
  • 11.7k