2,443 Posted Topics
Re: For one, your if statement should be && not || As it is now, if it is null it attempts to do equalsIgnoreCase on that nuill reference. | |
![]() | Re: Well, you need to first define what it is you need help with as I have no idea what you are talking about. What does a "-3 byte array" have to do with "FileHandling" and what [i]is[/i] a "2-3 byte array" in your definition in the first place. If you … |
Re: In what way? Ina display, of course, simply place them next to each other. In a "query" aspect? No. Give them all "names" that start the same, maybe? Edit: Or just simply to have a handy "list" that contains them all? Yes, just use a List or array. | |
Re: keySet to get the keys as a set, then iterate that. Edit: Not that "next" and "previous" have any [i]real[/i] meaning in a HashMap. | |
Re: Write a proper class, not a bad hack at a serial program. IOW [i]don't[/i] just put everything in main, and [i]catch[/i] and [i]handle[/i] (when possible) exceptions, don't just declare "throws Exception". The very least you should do is give out a proper error message rather than just dropping out. | |
Re: Use String's split method to get a String[] (which you can then use in the "enhanced" for loop) then use Integer.parse(String) to get the integer values for the switch. | |
Re: [url=http://download.oracle.com/javase/tutorial/essential/io/index.html]here[/url] | |
Re: It's called paging. Google "[url=http://www.lmgtfy.com/?q=java+paging]Java Paging[/url]". | |
Re: Is it "giving" [inlinecode]"SUCCESS"[/inlinecode] or [inlinecode]" SUCCESS"[/inlinecode] or [inlinecode]"SUCCESS "[/inlinecode] or .... I think you get the idea. The only lines after the print that will result in an NPE are the s.equals..., and since s contained [i]a[/i] value, seemingly, the line mesg = mesg.concat... is throwing the NPE. So, … | |
Re: Why!? [i]Why!? [b]Why!!?[/b][/i] I say! Why [i]all[/i] "beginners" [i]absolutely[/i] feel the [i]need[/i] to do this is just beyond me. I would think it would be much easier to simply Google "How do I deploy/distribute my Java app" and find out the [i]proper[/i] way to do it, rather than simply [i]assuming[/i] … | |
Re: It probably didn't "seem" slow, it probably [i]was[/i] slow. Properly handling DB connections and network traffic is a part of writing an application and simply circumventing those by building in a manual copy step to have the data local is a crutch and [i]not[/i] a solution. You should be opening … | |
Re: And think about whether you actually [i]need[/i] all "95000 lines" in memeory at the same time. You would be better off reading a line, processing that line, reading the next line. Only rarely do you actually need all of the data in memory at the same time. | |
Re: read System.in | |
Re: Are you providing any arguments on the command line? | |
Re: Uhm, with clear() ? See the API docs, Stack [i]does[/i] have a clear method. | |
Re: hostname is "mycomp" (fqdn) is "mycomp.my.internet.domain" | |
Re: By using a website that allows it. Your computer cannot just "magically" transmit bytes through the air without some sort of device to handle the signal. So, either you hook a handy up to your computer, or you find a web service that allows "free" sending of SMS and figure … | |
Re: Java doesn't have function pointers. | |
Re: Is that the first question in the quiz? No one here is going to write it for you. Explain, in greater detail, your current problem with it. If its that you "don't know where to start", as so many here like to say, then research what exactly such a thing … | |
Re: Do not use scriptlets in JSP, use, at the very least, a servlet. Do not cobble together statements like that, use a PreparedStatement. Use a Connection Pool (see the documentation for your web container). | |
Re: Do not use scriptlets in JSP. Do not cobble together statements like that, use a PreparedStatement. Use a Connection Pool. | |
Re: Okay? So do it. You have to make sure that that method exists in the class though, of course. P.S. Do [b][i]Not[/i][/b] cobble together statements unless you [i]want[/i] sporadic SQL syntax errors and (un)intentional SQL injection attacks. See the JDBC Tutorials for PreparedStatement (and don't say you have, because you … | |
Re: probably has to do with instance variables (i.e. bad programming) in your servlets/jsps | |
Re: A subclass must call a constructor of the super class. If you, as the programmer, do not program a specific super call in the constructor of the subclass the compiler will automatically add a call to the default constructor of the super class. Unfortunately, when the super class defines a … | |
Re: [url=http://download.oracle.com/javase/tutorial/uiswing/events/keylistener.html]here[/url] | |
Re: Use the method getResource which will return a URL to the loaded properties file so that you can use that url to both load and later store the properties. Edit: Assuming, of course, that the URL returned is a "file:" url, if not you will not be able to store … | |
Re: What return type should this method be or what should the method be "called" [code]public ImageIcon(String filename){[/code] you either haven't declared a return type or have not "named" it. | |
Re: Okay? And what do [i]we[/i] want with this copied code? | |
Re: Because it is assuming that numbers that start with 0 are octal numbers. ctal numbers can only have digits from 0-7. If you only want to move files where the number is greater then 030 do [code]mv *[3-9][0-9].jpg *[1-9][0-9][0-9].jpg destination[/code] | |
Re: One note. Do not use "\n", use System.getProperty("line.separator") to get the proper, platform-dependant line ending. Edit: A second note, it is probably more effecient to simply print each line indivudually, if you can, as each String concatenation creates a StringBuffer and a new String. Or better, would be to "build … | |
Re: For one you are trying to declare [i]something[/i] inside the main method. That doesn't work. For a second thing, [i]what[/i] is it? if it is a class, add that keyword, and put it in another java file, of course, if it is a method, then declare the return type. | |
Re: Okay? So what problems are you having with it? BTW we are [i]not[/i] just going to give you any "missing" pieces. | |
Re: Package it as a jarfile. See [url=http://download.oracle.com/javase/tutorial/deployment/jar/index.html]this[/url] and [url=http://download.oracle.com/javase/tutorial/deployment/index.html]this[/url]. As always the [url=http://download.oracle.com/javase/tutorial/]Tutorials[/url] nearly always help, even with this. | |
Re: It's pretty clear to me. You are trying to compile something as though it where source code using JDK version 1.4 when it is actually code that needs a JDK of 1.5 or higher. | |
Re: That the method returns an int (as its declaration will show), and these are the lines that do that, obviously. | |
Re: [code] $abc =~ /^ # Beginning of line [^\d]{2,4} # 2 to 4 characters as long as they are not numbers < # a literal less than sign ([^>]+) # at least one and all characters except (essentially until) a # greater than sign. This text will be remembered. # … | |
Re: Because you are doing this [i]completely[/i] wrong. From front to end. See the links I gave you in your other [url=http://www.daniweb.com/forums/thread345993.html]thread[/url]. | |
Re: That is not a JSP question, technically, and this is the wrong forum for a JSP question, anyway, there is a JSP forum, that is an HTML question. The real question is, why would you want a form without an action? What purpose would it serve? That is just some … | |
Re: [QUOTE=VernonDozier]if you want to display the buck object, you would do this: [code] System.out.println(buck.toString()); [/code][/QUOTE] Actually, it is unnecessary to call toString in a print statement. The print statements (print and println, not sure about printf, though, I should probably look into that) as those methods automatically use String.valueOf(argument), which, … | |
Re: first you want \. not . second you don't need capture group parens around the parens third, what you are missing is the replacement string, which would simply be - and the first capture group, of course (since there should only be one capture group). | |
Re: While needs a boolean. [code]while((ch = f.read()) != -1)[/code] Now, you look at the API docs and/or the Java IO Tutorials and tell me what that line is now doing and how it is different from yours. Edit: And format your code! | |
Re: First of all, properly format your code. How do you expect anyone to read that? Not to mention that that what you have will not compile, at all, since this [code]{ NIIT Developing Object Based Applications in Java Assignment A.9 [/code] is definately invalid code. | |
Re: Creaate class that extends JPanel and override the paintComponent method to draw the image. Edit: Of course, it would help to know exactly what the problem is that you're having with it. | |
Re: Do [i]not[/i] cobble together SQL statements like this. See the API docs and the JDBC tutorials for PreparedStatement. | |
Re: Uhm, setBackground(Color)? Don't forget to call setOpaque(true) on most components, however. |
The End.