1
vote
3answers
97 views

How to efficiently implement array element lookup and removal in Java?

Given a sorted array of objects, while the order is based on some object attribute. (Sorting is done via a List using Collections.sort() with a custom Comparator and then calling toArray()). ...
-2
votes
2answers
59 views

Trouble Passing an Array to an Arraylist [on hold]

Ok, so I have an assignment where we must create a java program which asks the user a contacts' name and and a variable amount of the numbers and number types(work, voip..) associated with the ...
1
vote
3answers
42 views

RGB creating with not a statement error

I have 39 errors but the are all the same error on the same thing (kindve) and I don't know what's wrong! The errors are all similar to this one: Setup.java:31: error: ')' expected ...
-1
votes
4answers
34 views

Java - is there something like binary stream?

I had one question. Is there library or etc to compose int & strings to byte array ? Like : byte temparray[] = new byte[10]; int a = 10; int b = 10; temparray << new String("12") ...
0
votes
2answers
33 views

Trying to print an array argument error

Im trying to print out the contents of an array and I'm running into an issue when looping through the array to print the elements. The error it is giving me is: The method ImportTeams() in the type ...
0
votes
1answer
27 views

Getting entire values from a custom resource file Android

Lets say I have some custom resource file called categories.xml in values folder which is as follows <resources> <string name="name_a" >A </string> <string name="name_b" >B ...
0
votes
2answers
47 views

Trying to create a structured array Java

I'd like to be able to create something like this: int points = 250; public class point { float x, y; } point[] p = new point[points]; // constructor public JavaMain() { Random r = new ...
-3
votes
1answer
47 views

How do I update my columns value in my 2 dimensional array in java?

Building a Sudoku game. How can I update my 2 dimensional array with the users input if they decide to input data using columns and not rows? I can not figure out why it will not work properly? ...
1
vote
2answers
57 views

how to make copy of array instead of reference in java? [duplicate]

I want to make an exact copy of given array to some other array but such that even though I change the value of any in the new array it does not change the value in the original array. I tried the ...
0
votes
6answers
58 views

Bad compile errors for a setup wizard

I am making a setup wizard for a tax application and I get errors that I don't know how to solve. Please help! My Error is: final String Colors = new String[]{"black", "blue", "cyan", ...
0
votes
2answers
63 views

how to set double latitude and double longitude into array

Hello please look at my code below. public class MainActivity extends Activity { Button btnShowLocation; // GPSTracker class GPSTracker gps; @Override public void onCreate(Bundle ...
0
votes
5answers
55 views

How do I call an Array constructor initializing the Array length?

How do I make a constructor to set the length of a global array? I have already tried several ways to do it, none successful. Example: public Class{ public Class(int length){ double[] ...
2
votes
3answers
63 views

Java: invoke Object vararg method with an int array

have a method with the following signature: public static String concatAndSeperate(Object seperator, Object... obj) The purpose of the method is to concat the objects in obj with a seperator in ...
3
votes
4answers
81 views

How to create ArrayList (ArrayList<Integer>) from array (int[]) in Java

I have seen the question: How to create ArrayList (ArrayList<T>) from array (T[]) However when I try that solution with following code, it doesn't quite work in all the cases: import ...
-2
votes
0answers
38 views

Convert 2-3-4 Balanced Tree to Array [on hold]

Hi all below is the task: How I would do this is first convert to a Red-Black Tree and then leave 0th index empty assign O = 1 , E = 2, S = 3 Later on I would continue with parent index k = child ...

1 2 3 4 5 488
15 30 50 per page