See: http://www.javaprogrammingforums.com/java-programming-tutorials/5518-common-java-mistakes.html#post18725
Type: Posts; User: newbie
See: http://www.javaprogrammingforums.com/java-programming-tutorials/5518-common-java-mistakes.html#post18725
We're not a homework service so please don't take the mickey.
Work on it yourself and come back with code and a specific problem you're facing. The simple answer however is to use the Scanner class...
You seem obsessed with proving everyone else wrong, when you've clearly provided no counter-arguments to the factual information given to you by everyone else. The API states a behaviour, you...
You're probably after JTable.
A tutorial by oracle: How to Use Tables (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
Google is a powerful tool however, simply...
Where do you read in the values from the properties file?
jbdc.url=jdbc:hsqldb:file:DBNAME
jbdc.username=sa
jbdc.password=
jbdc.driver=org.hsqldb.jdbcDriver
Something like this perhaps?
Be sure to read your laboratory documentation thoroughly, as...
Please be more specific in terms of what your problem is.
Post the code you're dealing with and the precise problems you're having. If you're weary that Marriott will penalize you for asking for...
public class SpoonfeedTest {
public static void main(String... args) {
LengthFinder lengthFinder = new LengthFinder();
String[] values = { "a", "b", "CC", "ddd", "b"};
String[]...
if(chance == 4)
( << WRONG
Customer newCustomer = new Customer();
customerQueue.add(newCustomer);
system.out.println("A new customer just entered the queue.\nTotal number of...
Duplicate posts on these forums are NOT permitted.
Persistent violations will result in action from the moderators, so be warned.
Do NOT post again in this thread, nor in this one.
Instead,...
Duplicate posts on these forums are NOT permitted.
Persistent violations will result in action from the moderators, so be warned.
Do NOT post again in this thread, nor in this one.
Instead,...
public void Magi()
I'm assuming by that you're referring to the constructor of the Magi class.
In that case, remove the return type VOID, and just have it as public Magi(), then it will display...
To guide you through this, I've made a quick demo of how you can write to a file using Formatter.
import java.io.File;
import java.util.Formatter;
public class FormatterTest {
public...
Also, can you provide more information including exact errors and code which errors refer to.
See my signature.
I saw that yes, and of course wondered why not ,but I also didn't expect you to post two irrelevant versions :D
Good luck.
Thanks for the update godlynom, could you kindly mark this thread as "Solved" now? (Thread tools > Mark this thread as solved).
As Math.random() only produces a value between 0.0 and 1.0, the highest value you can expect by multiplying by 10 is 10, and can be as low as 0.
As you're then using that variable to control the...
if(timer.isRunning()){
timer.stop();
bGolemi = 59;
bGolemj = 300;
bGolemk = 4;
timer.start();
}
The String "hello" has a length of 5.
As indices in Java start at 0, all the valid ranges are: 0 (h), 1 (e) , 2 (l) , 3 (l) , 4 (o).
If you let X reach a value equal to the length of the String,...
You'll need 3 "SoP"s to complete it.
Using your Ex2 as a base for it, notice how for(int x = 0; x < y; x++) will never be true the first time around, as both x and y would equal 0. This is the cause for you needing to add that extra...
2 Simple ways to do it, you can either:
Remove the else all together, and instead use a boolean variable which is set to true if a match is found, but outside the loop you test if(!matchfound) and...
Okay, how about you post a question outside of the code block, and post one with better detail.
If that is your original code, then "how do I deal with it" doesn't make much sense seeing as you're...
Nice to see norm has finally got his deserved title of super moderator :D.
Well done & keep contributin'.