2,443 Posted Topics
Re: What does the method signature [code]public int getorder()[/code] mean? And does the method actually fulfill that contract? | |
Re: What is the ".dat" file? That extension doesn't really [i]mean[/i] anything and many programs store many different types of things using that extension in many different formats. If know what is saved, and, more importantly, [i]how[/i] it is saved, we could give you a better answer. P.S. A BufferedReader will … | |
Re: Call split("\\s+") on the string that results from calling toUpperCase(). Then, on each element of that resulting array, call charAt(0) on the result of calling trim() on that element. ![]() | |
Re: Neither. The only language that [i]could[/i] be called "purely" OO (although there is no "official" definition of the term) is SmallTalk. | |
Re: FYI, this thread has already been marked solved, so I can only assume he had already figured out the answer (or had cross-posted on other forums so that we would waste our time answering), but the OP should have the decency to post the answer (not necessarily the "new" code … | |
Re: P.S. It [i]might[/i], in the future, help to [i]describe[/i] "don't work" precisely, as that is the singularly most useless problem description in the world. | |
Re: Well, rather than simply googling for finished code, you should be reading tutorials and the [URL=http://download.oracle.com/javase/6/docs/api/]API docs[/url]. See the API docs for URLConnection for info on how to get the headers, and there is a link in there to follow that will give you information about headers in general. Do … | |
Re: No. You can use the "length" together with a for loop and combination of two calls to substring with each iteration. | |
| |
Re: For the create statement you need only know how deep the second dimension is (i.e. the array[0].length) then use a loop to use String concatenation (or better two StringBuilders, but I don't know if you're ready for those) to create the sql for a CREATE TABLE statement and an INSERT … | |
Re: You need to restart the application after loading new classfiles. This happens automatically when you deploy a war file. | |
Re: Is this the same reason for all the Java stuff? And, if you are preparing for an "interview", don't you find it a bit late to be learning that for which you have applied? Common sense says you should have some idea about what it is you're applying for [i]before[/i] … | |
Re: Well, StringTokenizer won't help. Create an array of ((string.length() / 60) + 1) then use substring and a counter (starting at 0) to populate the elements. See the API docs for String, give it a try, and post that code. Edit: Nevermind, the problem is something completely different. String tokenizer … | |
Re: Okay? So where is your code and what is your problem? | |
Re: Because, according to your logic, you are only displaying an error when the username matches but the password does not. Why do you not simply query with the username and password and let the DB do the work? Also, you should not be storing plaintext passwords anywhere. Use MD5 and … | |
Re: I coould be completely wrong, because I always put it against the left edge anyway, but I believe the "END_SCRIPT" marker you are using to end the so-called here document, needs to be against the left hand side, in otherwords at the beginning of the new line. | |
Re: Then you may have [i]declared[/i] the variable outside the loop, but you didn't [i]initialise[/i] (i.e. define) it. IOW if you do [code]String bogus; while (true) { if (bogus.equals("Whatever")) { break; } }[/code] (as a contrived example) you will get that compiler message, whereas with [code]String bogus = ""; // or … | |
Re: dispose() after hiding. setVisisble(false) simply "hides" it, it does not "get rid of it". | |
Re: [QUOTE=stephy1]I guess i have to give a command line argument.[/QUOTE] As already siad [url=http://www.daniweb.com/forums/thread344107.html]here[/url]. | |
Re: Probably just simply two different instances of the program running at the same time. A so-called race-condition. Both checked table b and did not find a record and so both added it. | |
Re: Uhm, an array cannot create objects. After you "get the data from the user" use an if statement to check if the element of the array to which you want to assign the data is null, and if so, create an instance of the "object" assign it to that element. … | |
Re: By writing a class with a main method and another method, and three other classes that extend that class and override that "other" method. In the main you create four references to the original class by creating an instance of each of the four classes you've created than call the … | |
Re: Try the [url=http://download.oracle.com/javase/tutorial/java/nutsandbolts/op3.html]tutorials[/url]. | |
Re: [QUOTE=hanvyj]As for this: "If anybody knows anyother simple way to design a thread tell me." Are you asking about threads now? If you dont know how to do 2D arrays, leave threads for annother day.[/QUOTE] Well, investigate the posting history. | |
Re: Because i is defined within the loop and the condition of the lopp is, technically, outside the loop. A variable only "exists" within the scope in which it is created, in this case only [i]inside[/i] the loop and [i]not[/i] outside. Edit: Do note, however, that a variable created [i]outside[/i] the … | |
Re: It is the "path" on which "class"es will be searched for by the jvm/compiler. Edit: And [i]don't[/i] do this on the system environment CLASSPATH variable. I know I have told you this already, if running from a web container/app server place jars in the META-INF/lib directory (usually), if running/compiling from … | |
Re: What happens if n is 0 (or 1 for that matter)? P.S. that's a hint/clue. | |
Re: This is not the code you're running considering the message [code]syntax error at or near "["[/code] Edit: Not that you should be using scriptlets [i]at all[/i]. And also most definately [i]not[/i] be loading the driver and getting a new connection with every page load, use a pool. | |
Re: You can see how many by inspecting the int return of the executeUpdate which tells you how many were affected. If you want to tell [i]which[/i] ones, you are going to have to make a copy and compare, realising that other changes may have taken place between these actions. | |
Re: as long as it is taking place in the main method it is creating a reference to a file using a name provided on the command line (the first argument after the classname in the java command). | |
Re: You can't. As I have told you [url=http://www.daniweb.com/forums/thread343781.html]here[/url], simply assign some instance variable in the constructor and have the run method do different things based on the value of that/those variables. The only other way is to write three different classes. | |
Re: Uhm, this [inlinecode]MyStackThreads[j][/inlinecode] is [i]not[/i] a constructor. A constructor looks like [code]public ClassName(ParamType param) { // do something to "initialise" the class }[/code] | |
Re: See [url=http://www.daniweb.com/forums/thread344046.html]this response[/url]. Now it is no longer a warning. | |
Re: See [url=http://www.daniweb.com/forums/thread344046.html]this response[/url]. | |
Re: See [url=http://www.daniweb.com/forums/thread344046.html]this response[/url]. And you are now getting an infraction warning. | |
Re: See [url=http://www.daniweb.com/forums/thread344046.html]this response[/url]. | |
Re: Sure. Will we give it to you, no. We are here to [i]help[/i] [b]you[/b] correct [i]your[/i] code, we are not here to do your (home)work for you. If that is all you are looking for go [url=http://www.rent-a-coder.com/]here[/url]. | |
Re: Using different text (and different formating) depending on the language and/or region. | |
Re: Show your new code, it looks like you are multiplying the last number by ten (or maybe just adding a zero to the end through some other manner). P.S. I would also suggest not using "2.0" in your modulo statement, just use 2, otherwise you are making that a double … | |
Re: Try increasing your permgen space. (Google that and see your server documentation as to where to make the change.) | |
Re: Okay? So what is your problem? | |
Re: Well, it [i]might[/i] help to see that part of your code. | |
Re: That * catches [i]both[/i] files on the same command, so it assumes you are trying to move [i]both[/i] files to a directory. You will have to handle them one at a time (i.e. [i]without[/i] the * ). | |
Re: No there isn't, because it doesn't [i]have[/i] a name. The only thing you can do, is store the table in a Map and use the key that it is stored under as the "name". A variable is simply a way for the programmer to keep track of the reference. In … | |
Re: Write it to another file, delete the old and rename the new to the old. In this "special" circumstance you actually [i]could[/i] overwrite the five characters [pre]"#how"[/pre] with [pre]"how "[/pre] (note the extra space) using RandomAccessFile, but that is [i]not[/i], of course, the same as "deleting" the "#". File are … | |
Re: Well, you've declared name and color to be static. What does static mean? |
The End.