But how would I go about retrieving say a random object from both ArrayLists as if they were one? That's kind of why I was trying to see if I can co-mingle the data.
Type: Posts; User: mwebb
But how would I go about retrieving say a random object from both ArrayLists as if they were one? That's kind of why I was trying to see if I can co-mingle the data.
They contain mingled Strings and ints as in {1,2,3,4,5,6,7,"Food","Donut","Cow","STD"...}.
As of earlier I figured I could make the ints into Strings and cast them back into ints after retrieving them. But I'll clarify because I'm still open to better techniques.
I have 52 items that...
I have worked with these a few times but they are still somewhat of a mystery to me. I am currently working on a script in which I need to implement an ArrayList so I can edit the data when I need...
Hmm, interesting point. Well I am supposed to use the toRadians() method but I haven't figured out what to use that for. I'll try that.
EDIT: Well, turned out I am getting a closer figure when...
It's part of my assignment. Though, I keep getting different and negative numbers but I'm not sure why. I'm supposed to use the formula:
V^2*sin(2*A)
g
Where V = launch speed A = Angle (A...
Hmmm, well in the output there is supposed to be 42 numbers of data, 7 per column. So I don't really know....
Ahh stupid me. After the second for loop, a formula must be added to take the...
What is i in your example? So in comparison to my example, you mean set it up like:
myHUT[0][] = sot[];
myHUT[1][] = fet[];
wouldn't that mean not using the for loops then? I sort of need to use...
I am completely novice to the 2D arrays but so far I have been grasping the concept. Except one issue. I have an assignment that in one of the methods, a multi-dimensional array with columns and rows...
Ah, I did something like that, and got it working. Before I realized this forum was back to normal, I had the guys at Stack Overflow forum help me out. Thanks though.
For some reason I am having a very difficult time trying to initialize and store values in arrays within a constructor. When I use the debugger to check the arrays values, the Boolean all default to...
I have this borderline difficult HW assignment that introduced ArrayLists about a lesson back from the one I am on now. Currently I am having difficulty doing something (and wording) to make the...
EDIT: Fixed output too. The most obvious mistake I somehow managed to surpass took me almost 24 hours to notice...#-o
Well, one thing I noticed is that I'm only supposed to have 5 private instance variables. I added 3 more to use for the mutator methods (which I need). I think somehow I'm supposed to build the...
fillup[index].calcDistance(); didn't come up as an error and seemed to be a potential solution. But the thing is I have to go by certain guidelines. For example:
for (int index = 0; index <...
Dang, you guessed pretty good. Though that example is in 2 classes as well. I tried plainly making a separate statement in the main saying something like fillup.calcDistance(); but it didn't...
I thought I did that with myDist = myEndMiles - myStartMiles; in the calcDist method. Sorry I can't think straight. I have been on this literally all day (:|.
Hmm, well I edited
distance[index] = fillup[index].calcDistance(); to say
distance[index] = fillup[index].getDistance();.
It compiled but my output numbers in the terminal are all F'd up....
I'm gonna come out straight, this is a homework assignment. I almost got it done, but there is one main issue keeping me from compiling and finishing this. I have two classes. One is a tester (main...
The goal of it is to calculate each planet in our solar system its surface gravity. Though, I'm not sure what double[] gravities = calcGravity(radii, masses); is supposed to be doing. I am supposed...
This is NOT my code, but I'm supposed to use it to help me with completing the final thing. The problem is, when I compile it, I get an error saying that method calcGravity in class Gravity1 cannot...
Might have to go that route, though I am not familiar with a "switch statement".
The data in the variables will just be used to compute an answer from hex to decimal, binary, and char, and...
Yes I am using the Scanner class to read.
Those 10 variables are the only letters the user can enter, and any number. I chose those because they are necessary for Hexadecimal code lines, like...
*Sigh*, well I am trying to add a feature to a converter script of mine that also accepts Hexadecimal input and outputs it in decimal, binary, and text. There's not really any code that is causing...
I see, well now that I got that established, my other current major issues are numbered in my starting post...