- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 51
- Posts with Upvotes
- 49
- Upvoting Members
- 29
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Re: It is significant if you have a million nodes. You won't need to traverse to the end of the list if you simply maintain a tail reference to the last node. | |
Re: Can you ask a more specific question? What is it you don't understand? | |
Re: [QUOTE]Caused by: java.io.FileNotFoundException: C:\Program Files\Java\jdk1.6.0_20\bin\FirstApplet\class.class (The system cannot find the path specified)[/QUOTE] It looks like the browser or appletviewer is looking for the applet in the wrong place. You should have the .html file and the .class file in the same directory so the browser or appletviewer can find your … | |
Re: hatux, please start a new thread when you have a question of your own. This thread belongs to enuff4life concerning the original post. | |
Re: Here's an example: public class MyClass { // member variable can't be accessed directly in static method private String name; public static void main(String[] args) { // create an object to access its member variables MyClass test = new MyClass(); test.name = "any name"; // ... do some other stuff … | |
Re: You can read about borders [here](http://docs.oracle.com/javase/tutorial/uiswing/components/border.html). The page starts with this comment. > "Every JComponent can have one or more borders. Borders are incredibly useful objects that, while not themselves components, know how to draw the edges of Swing components. Borders are useful not only for drawing lines and fancy … | |
Re: You could store the user's guess in an array of characters which you initialize with '-' characters. When the user gets a letter correct, put that letter in the correct spot in the array. Then when you display the array you will have the dashes and the letters in the … | |
Re: The problem is you are not incrementing index inside your while loop so you're always looking at the first character of the input string. | |
Re: According to [URL="http://jroller.com/mipsJava/entry/sizeof_java_objects"]this article[/URL], a Vector in Java takes 80 bytes and each Double takes 16. Unfortunately it is not possible to store a primitive type in a collection like LinkedList or HashMap. The best (most memory efficient) route, as JamesCherrill suggested, is to use an array of primitive types. … | |
Re: I would write a helper method, call it something like [ICODE]foundPrevious[/ICODE], that takes your array, an index, and a string. It's a boolean method that searches the array from index 0 up to the input index searching for the input string. If it finds the string at any point, it … | |
Re: According to [URL="http://www.ibm.com/developerworks/java/library/j-webstart/"]this document[/URL]: [QUOTE]All the files for your application must be stored in a set of JAR files, including resources such as images and sound files.[/QUOTE] | |
Re: This is not exactly the same as your question, but perhaps it will help? [URL="http://stackoverflow.com/questions/2150265/retrieve-an-image-stored-as-blob-on-a-mysql-db"]http://stackoverflow.com/questions/2150265/retrieve-an-image-stored-as-blob-on-a-mysql-db[/URL] | |
Re: The first error says you are using a variable called [ICODE]average[/ICODE] which you haven't declared. The rest of the errors have to do with the [ICODE]TextIO[/ICODE] class, probably because you're missing an import statement. If you post again, please put your code inside CODE tags so it gets properly indented … | |
Re: The error is probably because the call to [ICODE]nextInt[/ICODE] on line 29 does not advance the read pointer to the next line. Try moving line 28 to after line 29 and take the comment marker off. If this doesn't fix the problem, please post your student class and attach the … | |
Re: Not enough info to determine what the problem is. Please post your entire program. | |
Re: If you have a new question, please mark this thread solved and start a new thread. | |
Re: What you have looks close to what you need. Just some things are a bit out of order. 1. Move line 22 to come before line 20. 2. You need more variables to keep track of your data: - 1 variable to store the total number of marks entered. I … | |
Re: Let's start with a definition of "inventory management system". What does this mean to you? Can you describe some of the features such a system would have? | |
Re: When I run your program I get the following output: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> [/CODE] If I change to [url]www.google.com[/url] I get the following: [CODE] <!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Google</title><script>window.google={kEI:"Di_sTNHhLoeMeLqA1Z0B",kEXPI:"27690,27818",kCSI:{e:"27690,27818",ei:"Di_sTNHhLoeMeLqA1Z0B",expi:"27690,27818"},ml:function(){},kHL:"en",time:function(){return(new Date).getTime()},log:function(b,d, [/CODE] | |
Re: You need two main loops for this program. The outer one runs the test inside 50 times. The inner one goes the number of times the user asks for. I would use 4 arrays with 6 elements each for this problem. The first array stores the number of dice rolls … | |
Re: I'm guessing you really mean sending an object, not a class. Is that right? An object can be serialized in a number of ways and sent through a stream. There is a serialization mechanism in Java (google it), but you can also write out the data in an object to … | |
Re: You said in your first post that Java is an ambiguous language. This is not true. Ambiguous means there is more than one way to interpret it. This is a feature of natural languages, but is very bad in programming languages. However, what Java is, is very general purpose, which … | |
| Re: You should start by trying to read the input file. Just write a program that opens the file, reads each line and prints them out. Test this to make sure it works. Next, modify your program to create an array of ints based on the first number you read from … |
Re: Here's an example of bubble sort on an array of int's copied from [URL="http://www.dreamincode.net/code/snippet513.htm"]this web page[/URL]. [CODE] private void bubbleSort(int[] unsortedArray, int length) { int temp, counter, index; for(counter=0; counter<length-1; counter++) { //Loop once for each element in the array. for(index=0; index<length-1-counter; index++) { //Once for each element, minus the … | |
Re: If I understand your question correctly, I think what you need is a [URL="http://download.oracle.com/javase/6/docs/api/javax/swing/JScrollPane.html"]JScrollPane[/URL]. | |
Re: This can be done using a [URL="http://download.oracle.com/javase/6/docs/api/javax/swing/JComboBox.html"]JComboBox[/URL]. | |
Re: I believe it comes from the word "template", and Java also uses the term "generic", which you can google. The idea is that you want a data structure that can operate on any kind of data. So you don't want to write a Binary Tree class that only deals with … | |
Re: First you need to get your menu working in a loop: On line 20 put [icode]boolean done = false;[/icode]. Then between lines 21 & 22, put [icode]while (!done) {[/icode]. Then between lines 43 & 44 put [icode]done = true;[/icode]. Then between lines 45 & 46 put another close curly brace. … | |
Re: In your printf statement, you use %d which is used for integers, but you associate with that the variable t, which is a double. The error message is saying that %d cannot be used with a double. |