1,678 Posted Topics
Re: Look at the javadoc for scanner: [url]http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html[/url] where do you see a method called read? None exists. Hence your error. | |
Re: Your question makes no sense. Rephrase it. | |
Re: Jemz - You can use PrintWriter's print(String) method in order to make sure your text ends up aligned properly. Since all that will be printed is the String that you supply, you can output whatever you want, followed by spaces, other text, whatever, and then when you want to go … | |
Re: And as verruckt so kindly pointed out, your response was not necessary because all of the issues had already been cleared up. Your mention of needing the bugs to be listed was unnecessary because the problem was already answered without that information. | |
Re: [QUOTE=hket89;1117000]But how I gona to make sure every number from 1 to 8 are come out in a pairs?[/QUOTE] You would just use the method randomInt twice to get a pair. If you mean that you wouldn't want a duplicate value in your pair, then you would keep calling it … | |
Re: But what problem are you having? You just posted code with no apparent errors or explanation. | |
Re: [url]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#length%28%29[/url] Read the length() method. Use it. | |
Re: [QUOTE=beforetheyknew;1116662]Hi guys just wanting some help with exceptions. I understand the try and catch concept but I struggle more with the throw and throws concept, it is my understanding (that may be incorrect), that you a method can be like [CODE]public class thisMethod throws whateverException[/CODE] Am I right in thinking … | |
Re: Hi Dave, Your snippets weren't hard for me to find because in 'site search' under 'thread prefixes' there is an option that says 'code snippets'. Combined with entering your username in the username to search for field, it wasn't very hard at all to find your snippets. Also, as an … | |
Re: The lookup would probably be performed in constant time. Otherwise why bother having a numerical key for your database table? I don't know what algorithm you're talking about though. I'd assume it is, at least conceptually, just an array of some sort. Then when you want to get all the … | |
Re: [QUOTE=Schecter;1112007][url]http://www.youtube.com/watch?v=cL9Wu2kWwSY[/url] 50 years and a single computer will be more powerful than the entire human population. rad.[/QUOTE] Yet still not capable of any thought beyond what it was programmed to think, which is a severe limitation. | |
Re: If you follow the daniweb rules pertaining to how to post a question, which are found in a thread at the top of this forum, we'd be glad to help. Basically you need to post as much information as possible (about your problem), show effort in solving the problem on … | |
Re: [QUOTE=rickywh;1116108]I'm using a socket server that is based off of java and it allows java extensions to be implemented that allow server side login to be performed. I want to create a signup/login system but I'm struggling with finding a way to validate/filter user input before manipulating with the database. … | |
Re: Why do you need a StringSelection Object? You should just need the String, i.e. the one that is stored in your variable called 'selection'. Btw, the error is that you're using PrintWriter's "print" method, and you are passing it a StringSelection Object. But if you look at the class documentation … | |
Re: You have to keep track of the length of your array and shift the elements all back one, like verruckt said, every time that you 'delete' an element. The true underlying size of the array is not changing. | |
Re: You wouldn't use a while loop to loop over an array [in this case], you would use a for loop, since the size of the array is known in advance. To find the max number make an Integer variable max, write a for loop that loops over the entire array … | |
Re: Combine the path that JFileChooser undoubtedly returns with this: [url]http://forums.sun.com/thread.jspa?threadID=760337[/url] There might be more current solutions available, and in fact I wrote the exact program you're describing myself, but since my program is on my older machine... you're out of luck there. | |
Re: Try to do it yourself, ask specific questions if you have any. | |
Re: Lol - outsourcing to geek squad?? First that is an American company associated with Best Buy, second it doesn't even require a college degree to work there. | |
Re: Post code in code tags. You'll notice the button that says 'code' right above the reply box, it makes it easier for us to help you. And welcome to the forums. :) | |
Re: Use division by 100 in combination with the 'int' primitive type to see how many dollars you have. For example, [CODE]int dollars = cents/100;[/CODE] No matter what (int) value you have for cents, at the end of that operation, dollars will be an integer, so it will have the exact … | |
Re: You only need two variables, one to hold the largest integer and one to hold the smallest integer. Initially, you should set both the large integer and the small integer to the first value read in. For each of the four values afterwards, you should use your if statements to … | |
Re: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/table.html[/url] That contains everything you need to know about a JTable. Read. | |
Re: Print something to your screen? Or send something to the printer? 1. System.out.println() 2. [url]http://java.sun.com/developer/technicalArticles/Printing/SwingPrinting/[/url] | |
Re: Then you probably don't have the console view (or whatever netbeans calls it) open on netbeans. So it is probably producing the output but not showing it to you. I can tell by looking at your program that it works, but I ran it just in case, and it works … | |
Re: To force a singleton I suppose you could simply use a getInstance method and refuse to return an instance if one already exists. I *think* you could enforce this by instantiating a private constructor (thus preventing anyone from calling it outside the class). By instantiating a private constructor, you are … | |
Re: No, do not use roseindia. There are some good learning materials stickied at the top of this site. | |
Re: Look into the File class, it will allow you to create a new File by a given name, I think. And also look into the PrintWriter class which will allow you to output to a text file. | |
Re: Well the depth is the length of the path from the root of the tree to the node (the number of edges encountered). A binary tree has two children so you can write a simple method that takes a depth (originally passed in as 0) and a Node (the root … | |
Re: [url]http://java.sun.com/docs/books/tutorial/java/javaOO/objectcreation.html[/url] this is all you will ever need to know about creating objects. | |
Re: [QUOTE=jbennet;1018156]keyword - *generally*, i guess you get the special treatment[/QUOTE] He's a sponsor. As an admin, it makes sense to give sponsors little things like that. | |
Re: Wow. . seriously? Go to the php forum. Start a new thread. This thread was started in 2005. | |
Re: Yeah, you'll find them in a dictionary. Try Merriam Webster. They have a website as well. | |
Re: Use Scanner, not BufferedReader. Create the Scanner then use scanner.nextLine(). Print out the line that nextLine() returns, and you're done. You could use BufferedReader also and just read in bytes while its not = '\n' also, I suppose. | |
Re: Nobody is giving you anything except advice (and I find even that doubtful at this point). Read the rules or go away. | |
Re: [QUOTE=characteredu;1100856]I am using the real version of google [/QUOTE] What's that? Teach us more. | |
Re: [QUOTE=Aia;868005]And why not use a [I]flux capacitor[/I]?[/QUOTE] 42. Also, I missed something here, because I was going to answer "You use the malloc function to dynamically allocate the array's memory. ." or something along those lines. Anyone care to clarify? | |
Re: @ poster above me: init doesn't mean alloc. If you're assuming that space has already been set aside for your array (i.e. the array already exists) then simply by updating the appropriate variables (e.g. size, last index, whatever) you can init in constant time. Similarly, for adding, if you keep … | |
Re: "i think the most grievous offender is the row of "share this" "send that" "bookmark" "yadda yadda" buttons... I think they're ugly and extremely distracting/annoying. i would get rid of all that, because i never use any of that stuff. i think it would go a long way to cleaning … ![]() | |
Re: So this is basically... similar to Scrabble? So you need two things: 1. Anagram finder to find every possible anagram 2. Simple search of your dictionary to see which anagram results in the most points. P.S. I'm not a genius on the subject but it seems like you need to … | |
Re: My girlfriend bought me a small hdtv (for playing video games). Other than that I got a pair of basketball shoes & a ball. | |
Re: Not saying that these data structures are the most efficient, but one thing you could do is read the entire file into a String (would be inefficient), then search by substring. Continuously increase the size of the substring until it either didn't match the word you're looking for or you … | |
Re: [url]http://www.csee.umbc.edu/courses/undergraduate/341/fall08/projects/proj5/HuffmanExplanation.html[/url] That article explains the entire process, in detail, and it is the only resource needed to completely implement the huffman coding algorithm. I know because that is from my course website from Fall 2008 when I had to do that project. | |
Re: Java, because since I am already reasonably good at it, I'd like to become expert. | |
Re: Grab an algorithms book or tutorial and read a little bit, if you're thinking you're going to get a ready made formula like a 'typical' math formula, you're on the wrong track. You might want to read about asymptotic analysis, runtime analysis, Big O, and connected topics that come up … | |
Re: [QUOTE=vegaseat;1059312]If time has no start and no end, what was before the Big Bang?[/QUOTE] The point of that theory is that people's concept of time is untrue, i.e., there is no such thing as a start or an end. So the theory says that your question is meaningless. | |
Re: It can only do [I]one[/I] operation (not two), addition is only one operation . . the reason it can only do one operation is because once the equal sign is clicked, you only scan through num1 and num2 and take an appropriate operation on those variables. In order to allow … | |
Re: I'm not sure what the android environment is, but if that is referring to the phone which I think it is, then check out Java ME. [url]http://java.sun.com/javame/index.jsp[/url] And then use the phone when testing. | |
Re: Not that I'm going to help, because I'm not, but the origin of number systems has nothing to do with programming languages, so I don't understand your response, Seten. |
The End.