I'm having problem with not outputting the correct result. I only get the original permutation back. It doesn't want to iterate through the rest of the letters.
Question is, I'm following the...
Type: Posts; User: steel55677
I'm having problem with not outputting the correct result. I only get the original permutation back. It doesn't want to iterate through the rest of the letters.
Question is, I'm following the...
I'm having problem with not outputting the correct result. I only get the original permutation back. It doesn't want to iterate through the rest of the letters.
Question is, I'm following the...
toString method is to format whatever you want to print out from a class (object).
The general form is Object newObject = new Object(Constructor parameters );
The toString method doesn't need...
Because my teacher wants us to code our own code which means we can't use java's api other than arraylist. we had to make our own arraylist class from array. and i get that, i'm just making a simple...
I'll go ahead and try that. I think I should be able to implement/extend ArrayList class. Thanks
Yes, that code is exactly what I want. I want an arraylist of arraylist. But, I don't know how to generate generic arraylist so that the names aren't predefined. The name of the arraylist is whatever...
Thanks, I tried to do it last night. This is my map currently.
public class OwnMap<Key,Value>{
static private Object Key, Value;
public OwnMap(Object Key, Object Value){
...
Hi,
How do you create ArrayList for individual items like this:
Object str = "A"
ArrayList<Objects> str = new ArrayList<Objects>();
I'm making my own Hashmap but I don't know how to create...
thanks, i've gotten it to work correctly now.
i got one last question, is there a way to store rectangle/oval or any shape so that when i make an eraser button, i can remove it?
Thanks, now I've changed it to:
public class PaintHere extends Canvas{
}
I'm hoping canvas would work because on the description it says: "A Canvas component represents a...
got it, my first step. I added it as an inner class, is that okay? or do i need to make it outside of my etch a sketch class?
public class paint extends JPanel{
}
Yeah =\. I wished I did mine out of scratch but we're suppose to use our prof's pre-made program and then do the modifications there. I made a quick tester just like that and it worked when I used...
I see. I added repaint(); after mouseReleased and whenever I tried to draw a rectangle, it still won't show up :(. I'm really confused on how it is able to draw on the GUI when it's at mouseDragged...
when i make a
public void paint(Graphics g){} in this program, it wouldn't do anything. But when I put it at the method mouseDrag, it would draw. But it doesn't work if I want to make rectanges...
Yes sir,
I've looked at his pseudo code
and this what I came up with.
for (int stopInd = arr.length - 1; stopInd >= 0; stopInd--) { // for stopInd = index of last element DOWNTO 0...
Here: int positionOfMax = indOfMax(arr,stopInd);
We're to write a method that finds the biggest item's index in the indofMax method.
then we're to use the indofMax method to make the range...
Hi, I've been working on this part of the code for at least 10 hours.
private static void selectionSort( int[] arr )
{
for (int stopInd = arr.length - 1; stopInd >= 0; stopInd--) {...
Ok thanks, I'm going to try finding that error and see what happens when I change it to variable
Player.getComputerMove(game, nextTurn);
} else {
Player.getHumanMove(game, nextTurn);
and when I change the Player to Game game instead of Player game, like this
public static void...
I'm still not sure what static means, I just let Eclipse change it to make it work.
This is my Board object
public class Board {
public static int[][] board;
public static char[]...
i'm trying to finish up the last project in our course and i cant get this part to work. it won't let me compile it and doesn't tell me the reason , other than application errors when i try to find...
Fixed it :). Took about a week haha. but finally. I redone my validation method so that it searches through the entire array, then it finds the map of x's and O's and returns the value that it...
Oh! The previous post was about comparing Reference to a String and I accidently used UserMove=="A1" instead of UserMove.equals("A1").
and Okay, I tried using another method
public static...
My apologies, I edited in the original post but I'll say it here as well:
The new problem is that the 'X' by the user will always override the 'O's by the computer. For example, if I place X at...
Now I got a new problem :( can't seem to get my logic around it.