Hey guys - quick question.
I'm writing a little program just for the fun of it, and to start off I'm having the user enter a string - the string will be inputted in the same format but there...
Type: Posts; User: joshft91
Hey guys - quick question.
I'm writing a little program just for the fun of it, and to start off I'm having the user enter a string - the string will be inputted in the same format but there...
Thanks for the reply, newbie - ended up helping me a bit. Decided it was easier to put the string into an array of chars and to go from there.
/solved
Alright - I decided not to use substrings and decided to use the charAt method.
I'm getting somewhere on it ... but I've run in to sort of a problem. I need to check to see if a string contains...
Would it be possible to use substrings? And somehow go through it ...
What I need it to do is if it finds a certain character, to put it into a stack. I have everything else added for stacks and...
Hey guys - so I need to write a method that will take a String as a parameter, and then I'll need it to go through that string one character at a time.
What would be the best way to do this?
...
Alright, most of the code was pre-written like that. I'm supposed to just add a label. I wasn't aware that the bounds were required to be set - thanks.
Alright guys... not sure what's goin on here, but obviously something is happening that I"m unaware of. You can ignore the ActionEvent method at the bottom... What I want to do is have the word...
It appears that this works...
public void actionPerformed(ActionEvent event) {
if (event.getSource().equals(button1)) {
button1Count++;
...
Alright... Well I tried something like this - it compiles fine, but it increments the 2nd button only. :S
public void actionPerformed(ActionEvent event) {
if (event.equals(button1)){
...
Edit: Got it working - public void actionPerformed(ActionEvent event) {
buttonCount++;
button.setText(Integer.toString(buttonCount));
}
The second part to this problem...
I wasn't wasting my time... All I was saying was that I don't have a lot of other places to go for help.
I know I'm going to be incrementing it in the actionPerformed method. The text is set here...
Hey guys... so here's the "problem" now. When you compile and run this code as of now, it will bring up a screen with a button on it - when you click teh button it will do nothing.
We're supposed...
Hey guys, quick question here - I'm supposed to identify which calls to the constructor are invalid - here's the code. Note this is not compilable, it's just the example that the book gives.
My...
Ah-ha! I called it this way and it appears to be sorting just fine...
mergeSort_srt(randomArray2,0,randomArray2.length-1);
Hm.... I'm not super familiar with arrays yet, and I've tried different ways of calling the method but with no success. My thought process was that the lo, indicated by randomArray[0] through...
Thanks for the reply.
We're supposed to create two arrays and sort array2 so we ahve the first one as an original.
I stripped the code down as far as I could and got this... it still doesn't...
Hey guys ...
Alright, I have my sort implemented and everything compiles fine. Up in my main I have an array of 100 random integers... then I call the mergeSort method with
...
Alright,
So I have my class set up with five different sort methods (merge, insertion, etc)...
My main method looks like this.
public static void main(String[] args) {
int[]...
Right now, when I press the run button in Eclipse, it will start at number 1 and ask the user to enter an integer. If I press enter without entering anything, the program will quit. Since the...
Hey guys -
Alright, so for this assignment, we're "simulating" entering high temperature values into an array. The array is of size 32, and each index in the array corresponds to the day (hence...
Little bump here. I posted this thread over on a different forums...
Creating a test class - Java Forums
Got any insight?
Alright, I read that but I'm still unsure how to incorporate a method into that.
public void nextWeek() {
for (int i = 0; i <7; i++) {
tomorrow();
}
}
Alright, I got that fixed. Everything up in the constructor works correctly now.
However, the problem I'm having now it the "nextWeek()" method. My "tomorrow()" method works completely fine - I...
Did you read my intro? Let me know when you do.
I think I'll be moving to a different forum for help ... thanks for the ... uh ... help in your second post? Oh wait.
Alright, thanks for the reply. Here's a question I have regarding the setup of the constructor.
public Date (String month, int day, int year) {
if...