1,678 Posted Topics
Re: Then please ask your question in a separate thread. Yes it is possible and yes I know how to do it, but I just won't answer if you hijack 2 year old threads. | |
Re: Can you give a [I]short[/I] example text file, and tell us how the records would be created for that text file? Because the design that your teacher gave you makes no sense. Why would you pass the name of a text file to 'Concordance' only to pass the same name … | |
Re: [QUOTE=jon.kiparsky;1389248]I'm not sure Exceptions are your best bet here. They might be, but think carefully about what you want. Here's an example of a WRONG use of exceptions, which I've actually seen in production code. Never do this: public boolean isNumeric(String s) [CODE]{ try{ Integer.parseInt(s); return true; } catch (NumberFormatException … | |
Re: You have to pass your tire pressures as parameters to the constructor. You also have to modify your constructor so that it will take the parameters, and you also have to set your Pressure class's instance variables to the values you pass in when you call the constructor. | |
Re: I enjoyed Slumdog Millionaire, it was emotional in some parts, although I doubt it will be life changing or anything like that... | |
Re: You could set both the maximum and minimum size, although there may be a better/different way of doing it. setMaximumSize() setMinimumSize() in Javadocs. | |
Apologies if you already know about this/it isn't a problem for other people, but the banner at the top consistently covers up the Software Development drop down for me. Just letting someone know. Thanks :) | |
Re: Using ArrayList as a raw type isn't a good idea. You can use Java generics to enforce type checking. In other words you can change it to [ICODE]ArrayList<Double> list = new ArrayList<Double>();[/ICODE] in order to allow only Doubles in the list. That being said, you can use the Double class's … | |
Re: edit: I could be totally wrong, but I see nothing wrong with your code. Did you use the check on s.execute to verify that the query was successful? It returns 'true' if there are results. I see you used a similar check by checking if the ResultSet was null though. … | |
Re: IndexOutOfBoundsException typically means that you attempted to access an index of an array, but the index you tried to access was greater than the highest index of the array. So somewhere in the getStringArray method this is happening, although you didn't post that method's code. | |
Re: If you want help ask a specific question. At the very least, point us to a part of your assignment requirements that you don't understand how to implement and ask for clarification. If you don't understand the entire assignment, that's fine, but explain what you don't understand, why you don't … | |
Re: My inclination would be to have a class variable(s) that track the Mouse position. The way you could do this is by setting up the variables to track x, y position and in the MouseMoved method, first you'd update those variable, then you'd call repaint() which causes paint() to be … | |
Anybody here a fan of Chuck? I'm a pretty big fan - behind at the moment, but I've seen every episode except the last two. Giving our geeky hero superpowers was a risky move on the show's part, but it is still entertaining so far. I also liked his third … | |
Re: Make sure to put break after each part of the switch statement. And the reason it's telling you num1 and num2 are wrong is because you declared them from within one part of the switch statement, but then tried to use them within a different part of the switch statement. … | |
Re: No, I cannot, unless you own a never ending hard drive. ;) | |
Re: Can you explain your reason for putting Integers and Characters in the same array? Also why you'd want a "DoubleStack" ? | |
Re: In your new String, either "LHS" or "RHS" represents an Index which is no longer valid. Since replacing whitespace with "" makes your string shorter, your index is no longer valid in the new string. In your new string, which is shorter than the old string, more than likely the … | |
Re: [QUOTE=WaltP;1127168]Why? Why not get a computer from a reputable place that actually will give you service and put everything you need into the computer rather that an off-the-shelf this-is-what-we-got solution? And without all that extra crap software, too. In case of problems, do you get the M$ OS cd's so … | |
Re: Apologies if this has been stated, but I saw something about craigslist: Do not buy a car on craigslist. If you insist on doing so, at least compare the prices to other similar cars (according to make & model) and make sure the craigslist one isn't outrageously cheaper. And never … | |
Re: mm m, I like to add a little salt, herbs, and sig spamming in my pasta dishes! Delicious! | |
Re: [QUOTE=BLuv;1318537]russia being at the top of the list doesn't surprise me. they have a whole cyber army for goodness sake. (as does china i believe) where's the U.S.'s cyber army? =P[/QUOTE] In their Mom's basement | |
Re: Show us what you've got for your recursive function and why you're having difficulty. | |
Re: Yes. The HashMap class's add() method takes an Object as a parameter. As you can see in the Java language specification, arrays are Objects. See: [url]http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html[/url] [url]http://download.oracle.com/javase/1.4.2/docs/api/java/util/HashSet.html[/url] | |
Re: In this scenario, you are trying to make sure an Integer is in a certain range. So use a while loop and continuously prompt the user for a value until they enter one that is in the correct range. Generally, when you anticipate an event (such as an Integer that … | |
Re: If you're in a method, which you have to be, you could say "return;". I wouldn't worry about it too much if you have a working method though. | |
Re: From what I remember, essentially, they both dynamically (while the program is running) allocate memory for your program, and the main difference is that calloc sets all the memory (that it allocates to your program) to zero's while malloc does not. So after calling malloc, the memory that was set … | |
Re: Your Project class should have an ArrayList (or some data structure) to hold Employees in it. That way you will know what Employees are working on what project. As far as the Assignment class, I don't really understand what your teacher has in mind for what an Assignment actually [I]is[/I]. … | |
Re: Look at your brackets. You can't put a for loop in the middle of a class definition. It has to be inside of a method. On line 21, you put a '}' that closes your main method. Then you defined a method "getCourse()" and afterwards, you have a bunch of … | |
Re: Please don't ask unrelated questions in the same thread. Create a new thread with the appropriate title. That is, unless the questions (or answers to those questions) directly cause new problems. As for your actual question, have you tried using the setVisible(true) method? You may need to call a method … | |
Re: Use an if statement. [CODE] boolean firstGuess = true; long totalTimeMillis = 0; if (firstGuess){ ... } [/CODE] That should get you started | |
Re: I don't see how your catch statement could possibly generate that error. You misaligned your code. Where in the code does the error actually occur? | |
Re: That third post sounds about right, though I admit I haven't read all of your code. Let us know if you have any trouble. Welcome to the forums :) | |
Re: Why would you declare "k" as type float? It should be declared as an int. Also, the ";" at the end of the for loop ends the loop. In other words, the for loop does not apply to the line directly after it since the ";" is there. Repost the … | |
Re: They mean make a method that has a parameter, numberOfEggs, which is an integer. | |
Oracle Certified Professional Java Programmer was formerly known as the Sun Certified Java Programmer certification. Does anyone know if the switch to Oracle has changed anything significantly, such as the questions that will be on the test? Or is it the same cert with a new name? The reason I … | |
Re: Your program is stuck in an infinite loop. You said [CODE]while(number != -1)[B];[/B][/CODE]. Notice the ";". That causes the program to think "oh, the ; represents the end of the while loop". Remove that symbol and see what happens. You also never changed the value of [I]number[/I], so even after … | |
Re: Explain your problem better. It sounds to me like the command prompt is trying to tell you that the command line utility you're trying to use doesn't actually exist or cannot be found basically. But I'm no expert. Edit: To add to that I think there is a way in … | |
Re: [QUOTE=daudiam;1335799] ob is an array which is also treated as an object, and hence has a default clone method which is called at (1). But the default clone method returns an Object reference, so that should not be assignable to an array of type hello. But its being assigned here … | |
Re: I have two family members that bought Acer computers at around the same time. This was less than two years ago; neither computer is being used anymore - they both had to buy new laptops because of crappy parts. Basically the screen completely separated on my dads and I don't … | |
Hi everyone, I'm in a situation where I would like to have a ServerSocket that listens on a specific port. However, if this port is already taken, I would like to listen on a different port. How can I advertise what port my Java program is listening on, so that … | |
Re: OP: As a college student, when I go to career fairs and similar events, and talk to employers, the languages that are most often mentioned are C++ and Java as far as non-Web development goes. I don't know about web development. . AJAX seems to be popular as well as … | |
Re: Methods. Keep in mind that a method should do one thing and do it well. Some of your code can be broken down better; for example, you should have a method which gets [I]one[/I] judge's score and another method that calculates the overall total score. The overall method would call … | |
Re: No, there is no logic behind that. Why use a programming language if you're forbidden from using any of its features? But the question is intriguing.. How is the input read in without any Java API? Do you actually mean [I]no[/I] Java API methods are allowed? Or are certain ones … | |
[CODE] Integer i = 5; Integer j = 5; if (i == j) System.out.println("true"); [/CODE] ^ Prints true [CODE] Integer i = new Integer(5); Integer j = new Integer(5); if (i == j) System.out.println("true"); [/CODE] ^ Does not print true. I understand that in the second case, the == is … | |
Re: [QUOTE=Nikkie80;1198260] 1. What is your current job title? Professional student 2. What education requirements did you earn to prepare you for this job? I passed some classes. They let me take more. 3. What are the advantages/ disadvantages to this career choice? You pay someone, you don't get paid. 4. … | |
Re: So which part are you confused about? Reading in the values? Calculating the formulas? The formulas are standard formulas, so if you don't get them, just look up those terms on google and you'll find plenty of explanations. Your professor didn't make those up. And to read in the values, … | |
Re: Lol. That girl is a lunatic. Thankfully, my gf will not play any video games that aren't Mario Kart or Kingdom Hearts, and she rarely plays those. | |
Re: You're such a sweetheart Nick. | |
I read on various articles on google that a 'cron job' is used to schedule a task to run periodically on a server. I'm in a situation where I need to schedule a script to run nightly. The script would probably be written in php and update a MySQL database. … |
The End.