Questions tagged [arrayindexoutofboundsexception]
41 questions
0
votes
2 answers
Index out of bound, java
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 method should return 0.
for example if the method…
0
votes
1 answer
Append swing jbutton elements to array in java
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 form of an string array eg:…

Gamaray
- 68
- 1
- 8
0
votes
1 answer
Index out of bounds despite not being out of bounds?
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" is only one word, but other commands have two parts, command and int.…

kinkkelaade
- 1
- 2
0
votes
1 answer
i run the rmi program below but it shows command execution failed
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 screenshot few lines.
this is the…

YAChee
- 21
- 1
- 4
0
votes
1 answer
The Count of Remaining Arguments
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 prints out the count of numbers entered that are less…

gizmo.java
- 1
- 3
0
votes
1 answer
App crashes on putting more than 28 'composable' element inside AnimatedNavHost (Jetpack Compose)
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:
AnimatedNavHost(
navController =…

Sparsh Dutta
- 2,450
- 4
- 27
- 54
0
votes
0 answers
ArrayIndexOutOfBoundsException when Creating LinearLayout
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 widget image file, My app create some layout like a…

박찬준
- 346
- 1
- 7
0
votes
1 answer
Got ArrayIndexOutOfBoundException when not out of bound
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 EXPANDED_KEY_SIZE_IN_BYTE = 176;
private static int…

dtgrand
- 1
- 1
0
votes
1 answer
What is wrong with this binary search? IndexOutOfBounds
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.ArrayIndexOutOfBoundsException:
Index 222 out of bounds…

Hax
- 133
- 9
0
votes
1 answer
MAKING GAME BOARD: How do you shorten this code of creating array, and how do you print them out?
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;
// I wrote like this because I want each box to…

ICIS
- 9
- 1
0
votes
2 answers
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 with RMI
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 class RmiServer extends
…

anie
- 399
- 5
- 17
0
votes
1 answer
Primefaces 10 dataTable p:dataExporter generate ArrayIndexOutOfBoundsException on render after migration
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 out dataexporter the xhtml render well.
Following…

Joe
- 7,749
- 19
- 60
- 110
0
votes
2 answers
2D Array work, out of bounds error, for loop,
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 student IDs and 3 tests with scores for each of them,…

okay4
- 13
- 4
0
votes
1 answer
"Hello world" exercise in c++ throws ArrayIndexOutOfBoundsException
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
using namespace std;
int main(void)
{
cout << "Hello…

user1234554321
- 9
- 1
0
votes
1 answer
How to test ArrayIndexOutOfBoundsException?
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 that if args[0]==0 in main method,…

UserNumber5
- 9
- 1