- Upvotes Received
- 7
- Posts with Upvotes
- 6
- Upvoting Members
- 5
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
15 Posted Topics
Re: Hey! Ahh hatred for BlueJ. >.< I found that the official tutorials were great in explaining concepts, you'd be surprised how useful the internet can be for this kind of thing as an alternative to books. It's easier (for me at least) to search for specific subjects than trying to … | |
Re: stultuske appears to be right, this was my initial thought too. Otherwise, the logic is so basic that there really can't be any other error. Mathematically anything below zero * -1 is the positive version of that number, thats indisputable. In the case of all of the positive numbers, i … | |
Re: You just want to print something 10 times? How about an if statement which sets a previously empty string with the relevant message And then a while loop/forloop to print that string variable 10 times? Something like [CODE] String message = ""; if(ave>=75) System.out.println("REMARKS:PASSED"); message = "congratulations!"; else System.out.println("REMARKS:FAILED"); message … | |
Re: From what i can see, in cases where there is only one other common factor than 1, your method will return false, because 1 isn't accounted for in your count. Count should either start at 1 (because we know all pairs have 1) or you should change your condition so … | |
Re: I assume you're talking about String.contains(), please be specific there are lots of contains methods :) If you want to match a string more restrictively to patterns, i would suggest looking at regular expressions, which allow you to create a definition of a pattern, for example "abc" which will only … | |
Re: So you just need to return the reference of the current node, and thats it. The method return would simply call return (recursively) on this.next, get a value of the new "next" as its return type, allocate it to this.next, then return itself to the function that called it's return … | |
Re: I would suggest looking at Reverse Polish Notation, which is what most calculators use. Basically, it converts an expression into RPN, a form where all operators come after operands, (postfix) as opposed to in between. Wikipedia shows how a stack data structure can be effectively utilised for this. [url]http://en.wikipedia.org/wiki/Reverse_Polish_notation#Postfix_algorithm[/url] | |
Re: Basically what is happening here is that your second forloop is reading in the next character as an Int, as specified by the nextInt() method, but of course, the next character is '*', and so is a "mismatch". Removing the star and just using an empty line would fix this, … | |
Re: I don't understand, you don't assign a value to grade after grade = 0, How can you expect it to ever enter any of the if statements? And why are you assigning character values to an int object, "grade = 'A'"? ![]() | |
Re: So you're trying to add a foreign object to an array of this type? How about "thelist[0] = foreignObject; " and then just use a counter to add to the next index every time? | |
Re: You really should at least attempt to come up with a solution yourself, this is a help forum, not a do my work for me forum. You clearly have some programming knowledge, so think about it as a problem solving exercise, its simple enough, then implement it with programming. | |
Hey everyone. I have recently decided to try and learn how to use java Sockets for client/server communication, as well as swing and threads, etc. and have (pretty much) completed a small client server application. The application is basically a syntax-highlighting notepad, a client swing GUI which connects to a … | |
Re: Hey man. It might be a good idea in this situation to use a return type. In this case, your method is 'void' and so returns nothing, but if you made it of type ArrayList<Integer> you could send back the modified list so it could be printed. For example: [CODE] … | |
Re: I found your problem. On line 70, you are addressing the DatagramPacket to [B]clientport[/B] when it should be addressed to [B]port[/B], the member of the HashSet. I tested your code with this, and it works. Also, it might be a good idea to send a blank packet from the client … | |
Re: Yes, a simple counter would do the trick, and then to ensure the program only loops x times, just add the 'counter < x' condition to your do-while loop. |
The End.