Forum: Geeks' Lounge 3 Hours Ago |
| Replies: 305 Views: 21,720 Old German metal from my high school days: Helloween - I'm Alive (http://www.youtube.com/watch?v=OiZoGwXcP50)
Drummer can really work the double bass :) |
Forum: Java 5 Hours Ago |
| Replies: 13 Views: 9,021 Don't hijack threads with new questions. Start a new thread of your own.
And the answer to your second question is no. |
Forum: Java 9 Hours Ago |
| Replies: 5 Views: 166 Let's say your fares were in an array fares[3][]. Then your option group index directly corresponds to a fare scheduleselectedFare = fares[optionIndex];No need for a switch. The rest of your code... |
Forum: Java 1 Day Ago |
| Replies: 16 Views: 222 The "test" array has nothing at all to do with your code. It's just an array I used to put some data in so you could see how to use the formatted output hereSystem.out.printf(" %s | %s | %s... |
Forum: Java 1 Day Ago |
| Replies: 16 Views: 222 No, that part is up to you. I think my example comes plenty close. Anything more is essentially doing that part of your assignment for you. |
Forum: JavaScript / DHTML / AJAX 1 Day Ago |
| Replies: 2 Views: 114 Ok congratulations, you've demonstrated that you can paste your homework. Do you have any specific questions? Anything at all to show that you have given this the least bit of thought? |
Forum: Java 2 Days Ago |
| Replies: 6 Views: 157 |
Forum: Java 2 Days Ago |
| Replies: 9 Views: 127 Directly from the source: http://java.sun.com/docs/books/tutorial/java/package/index.html |
Forum: Java 2 Days Ago |
| Replies: 9 Views: 127 If you haven't specified a modifier and they are in a different package, they are private.
Use a public method getName() to get the name - don't access the variable directly. |
Forum: Java 2 Days Ago |
| Replies: 5 Views: 166 Just have an int[] array variable like "selectedFares[]" that points to the correct fare array. Your stateChanged method just needs to set it when they choose one, i.e.switch (option) {
case 0:
... |
Forum: Java 2 Days Ago |
| Replies: 9 Views: 127 If you have declared it private then you will need to use a public getter method to get the name. Same for balance. |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 You don't need a class name to call static methods within the same class - and that class name doesn't match anyway.
Also, make sure your method call matches the signature you wrote. You can't... |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 It has to be inside the class. Just declare it after main(). It should return a String.public static String getCityName() {after you get a value from the user, return that value; |
Forum: Java 2 Days Ago |
| Replies: 9 Views: 127 Well, move it outside main(). Cut-paste the entire thing outside of the braces that delimit the main() method. |
Forum: Java 2 Days Ago |
| Replies: 2 Views: 88 No, you don't put javadoc comments inside methods.
Edit: On an unrelated note, "Number" would be a really bad name for a boolean variable. Number is the base class for numeric wrapper classes like... |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 Don't put it in a separate class. It doesn't really have any context as a separate object.
Just make a method getCityName() that returns the String that the user entered. |
Forum: Java 2 Days Ago |
| Replies: 9 Views: 127 You can't declare methods inside other methods. Get consolidate() out of main(). |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 "case" is not capitalized. |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 Move your switch down below the point you are getting the input. You want to set the speed based on what they input and you want to switch on the first char of that entryswitch(roadChoice.charAt(0))... |
Forum: Java 2 Days Ago |
| Replies: 2 Views: 2,308 That is because it has nothing to do with Java itself. You're just sending a DDL statement to the database. Any difficulties with it would be specific to that database and the JDBC driver. |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 A and B are not variables themselves. They are two possible values for a variable that you want the user to set. So use a String variable for roadChoice that you read the input into. Then you can use... |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 Just like you got the other input, but you will need to use something like charAt (http://java.sun.com/javase/6/docs/api/java/lang/String.html#charAt(int))(0) to get the first character of the String... |
Forum: Java 2 Days Ago |
| Replies: 5 Views: 7,877 Yes, you are missing the fact that this is someone else's two year old thread and it's in Java, not C++. |
Forum: Java 2 Days Ago |
| Replies: 1 Views: 92 You don't need to re-create all of those things when you pick another file for the table. Just create a new table model from that file and use setModel()... |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 No. Change the value of speed separately from your print output. |
Forum: Java 2 Days Ago |
| Replies: 4 Views: 174 |
Forum: Java 2 Days Ago |
| Replies: 16 Views: 13,935 Hmm, wrong language and 'void main()'... batting zero so far. |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 For A and B you could use char values, but not string values in the switch. If you use a String, you would have to use if() statements. |
Forum: Website Reviews 2 Days Ago |
| Replies: 1 Views: 81 All of the image links are broken, so I would have to say... no. |
Forum: Java 2 Days Ago |
| Replies: 20 Views: 213 Just have the user enter a number for the road type. Then your switch can simply be switch (roadType) {
case 1:
speed = 50;
break;
case 2:
// ... etc
}You will have to remove... |
Forum: DaniWeb Community Feedback 3 Days Ago |
| Replies: 22 Views: 907 Get riled up easily much?
This isn't me in "shook my cage" mode. You were suggesting that if the system has no value at all, it should be scrapped. I merely pointed out that only a few have voiced... |
Forum: DaniWeb Community Feedback 3 Days Ago |
| Replies: 6 Views: 231 She's still about. Just a couple of days ago she popped in for this post in classic form: http://www.daniweb.com/forums/post1047754.html#post1047754 |
Forum: Java 3 Days Ago |
| Replies: 14 Views: 260 If "unsorted" contains any duplicates, yes. It just can't retrieve the same element from "unsorted" more than once. The first version could use unsorted.get(4) multiple times if 4 came up as the... |
Forum: Java 3 Days Ago |
| Replies: 14 Views: 260 It's actually removing the element from "unsorted". It grabs an element randomly between 0 and size()-1. |
Forum: Java 3 Days Ago |
| Replies: 16 Views: 222 Yes, those two lines are an example. As you said, you need to use theBoard[][]. |
Forum: Java 3 Days Ago |
| Replies: 14 Views: 260 If you don't want repeat selections, you can use this insteadkeys_Array[i] = (Integer) unsorted.remove( random.nextInt(unsorted.size()) ); |
Forum: Legacy and Other Languages 3 Days Ago |
| Replies: 3 Views: 157 Sounds like a job for Google.
You could start with this: http://en.wikipedia.org/wiki/Comparison_of_programming_languages |
Forum: Java 3 Days Ago |
| Replies: 16 Views: 222 Those are the array indexes. "test" was just a small String array. |
Forum: Java 3 Days Ago |
| Replies: 14 Views: 260 You have to cast the Object to Integer if you want to assign it to the array.keys_Array[i] = (Integer)unsorted.get(random.nextInt(100));Using generics to type your collections would avoid that. |
Forum: Java 3 Days Ago |
| Replies: 14 Views: 260 for(int i=0;i<100;i++){
keys_Array[i] = unsorted.get( random.nextInt(100) );
}Note that get() is used if 'unsorted' is an arraylist and not an array. |