Tagged Questions
-2
votes
0answers
26 views
concatenate two String of data error
I am creating a program to concatenate two String however I keep receiving an error with "dna.concat_DNAs" I tried making "dna.concat_DNAs" a constant and a field but I am still receiving can anyone ...
-1
votes
2answers
50 views
convert List<string> to string array
I wanted to split a json file and store its contents in an array and then print them out to the console, i have been successful in doing so except in the problem of converting List to a string array.
...
0
votes
3answers
54 views
[JAVA]Random number to store inside array list and choose from it
I am trying to create a program to generate random number and store into arraylist.
Meanwhile getting the number stored to do multiply.
I have store the generated number but how do I actually get the ...
2
votes
1answer
45 views
CipherOutputStream cannot write to ByteArrayOutputStream
I am trying to encrypt/decrypt a file, but I have a problem with ByteArrayOutputStream and CipherOutputStream. I'm able to encrypt a file, but cannot be decrypt the file. I have try to close the ...
1
vote
3answers
55 views
static arrays are not the same [java]
I'm trying to create a Java program that generates an amount of seats taken in an airplane. So far, I have been able to do this, but my problem is every time I run the client the numbers generated are ...
-2
votes
0answers
17 views
How to match and replace elements of rows/columns in 2D array in Java?
I'm working on a project where I need to match 3 or more elements in rows or columns of 2d array and if there are 3 or more consequent matches have to remove them and replace them with new random ...
-1
votes
0answers
10 views
Sanding elements of array to a oracle database table using for loop
Good morning everyone !
I have created a jsp page having some radio buttons. Now I am receiving the user response for those radio buttons in an array inside a servlet. Now I want to send these array ...
0
votes
3answers
38 views
Restricting decimal places in an array
Currently, the output of this array has a too large decimal place trail. How can I restrict this to say 2 decimal places? By this I mean the array 'percentage1'. I've seen methods to do it online, but ...
0
votes
3answers
18 views
Trouble with swap method-java
Hello everyone I am currently creating a program where I want to swap index 2 and 4. I have the code completed however I do not receive an output and when I run the program I do not receive an error
...
0
votes
0answers
15 views
Create and update an object for an element of an array? Android
This question is about AndEngine/Android but pertains also to Java. I have an NPC class in my game that when the player gets close to them, I want them to show a message by creating a rectangle/text ...
0
votes
3answers
66 views
How are primitive arrays implemented in java?
There are several questions that are similar to this one here on S.O., but they don't quite answer what the code implementation is. I've looked at
Why isn't there a java.lang.Array class? If a ...
0
votes
2answers
72 views
Java integer array, I cant do simple maths it seems
I have the code below:
int lines = 0;
while(lines < 2)
{
int[] oldarr = parr;
for(int i = 0; i < arrsize; i++)
System.out.print(" " + oldarr[i]);
System.out.println();
...
0
votes
5answers
70 views
Convert ArrayList<String> to java.util.List
I'm having trouble wrapping my head around a concept. I'm trying to convert a ArrayList(String) to a List (or List(String)), but I keep running into a cast exception. Yes I saw the code to convert a ...
0
votes
2answers
46 views
Returning a single array value with each method call starting at index 0 and incrementing 1 with each call.
Hey guy I have searched the web and am having a hard time finding an answer to this question so Im thinking it may not be possible, am I able to use a method to call an single array variable with each ...
0
votes
1answer
32 views
How to find last element in an array by specific key
i have to find the first and the last element by a specific key (with a binary search method). I'm already done with the searchFirst method but i'm not able to complete the searchLast method. ...