| Author |
Message |
|
|
Besides possible security issues I don't see why you couldn't put this online. Anytime you have something listening on a public port on a public machine you do need to be careful.
But based on what you've said it sounds like it will work fine on the internet.
|
 |
|
|
What have you coded to this point? This doesn't sound too bad. The first thing you'll do is declare the array:
This gives you an array that will hold 10 int's.
Then you'll need to fill the array with some sort of loop. You don't say what version of Java you're using but if you're on 1.5 there is a nice class called Scanner that can help you read from the command line. You'll want to have a loop that loops 10 times. Remember that arrays are zero based - the first element is myArray[0] and the last element is myArray[9] in this example.
Once you've filled your array you will loop over it and count how many elements are above 40 and how many are below.
Let us know where you get stuck - good luck!
|
 |
|
|
Just remove the "while (min <= max)" loop. The code I showed was supposed to replace that loop. If you remove that you get:
|
 |
|
|
|
Can you post all the code? Wrap it in the [code] and [/code] tags and it is much easier to read.
|
 |
|
|
The loop:
doesn't do anything that is visible - that is there is no printing of the variables you've calculated.
To make the code a little more understandable I'd do something like:
and get rid of the last loop all together.
|
 |
|
|
|
It sounds like your JNDI may not be set up correctly. I'm totally unfamiliar with WSAD but if there is a way to first verify that your JNDI environment is correct first I'd start there.
|
 |
|
|
There really is no problem with having multiple Java versions on the machine. I have a similar setup in that my development environment is 1.4 but there is a 1.5 on the machine too for the browser.
As far as the disk - the Java runtime environment is a decent size and will certainly cause some disk activity when it is used. However, it wouldn't be any different than any other larger program such as Microsoft Word. I'd be concerned a little that the noise seems to change when the machine gets warm - you might want to make sure you have some good backups.
|
 |
|
|
tfecw wrote:Also, what do you mean by a "full stop"?
You have to have worked for a company based in London as I did for a few years - it is a period for those of us not using the Queens English
|
 |
|
|
|
It looks like Instruction is indeed abstract. I'm not familiar with BCEL directly but it looks like you don't create the Instruction class directly but rather via an InstructionFactory. This class has a many method for returning an Instruction.
|
 |
|
|
|
Do you have some sort of "driver" program for this? It compiles as is but won't run. I'd be glad to help but it is tough to find the problem without the entire set of code.
|
 |
|
|
I'm pretty confused by the what issues you're having. What are you trying to do with Java? Is this for applets or developement? I use XP SP2 on several machines without any issues. Sun does release periodic updates to the software but I agree that it shouldn't tell you that you need to upgrade everytime.
As an aside, XML is a transport type of language like HTML. It is not a programming language like Java, C, C++, etc.
|
 |
|
|
The error is telling you that you can't pass the two int's to the method insertionSort(). This method is declared as taking an int array:
but you're passing two ints:
What did you really want to pass it?
|
 |
|
|
You'll want to save the return value of newInstance() by changing
to:
newInstance() returns the same thing as if you called new() for the class.
The only issue you have here is that you have multiple versions of the same class so you may have to do one of two things:
1) Have a conditional that tests which type you're creating and create and call that as needed
2) Have a common base class or interface that the other classes inherit from or implement. This is the prefered method in my mind.
|
 |
|
|
Your best bet would be to simply walk through the sentence and count them:
You might also look at using the method split() in the String class or, if you're on a JDK that is 1.3 or less, StringTokenizer. However, depending on how you configure these they can collapse multiple spaces into a single space. That is if your String contains many spaces between the words you might only count one space.
And the second part can simply be:
to add the period or full stop character.
|
 |
|
|
Do you know where it is hanging? I'd be concerned with your loop logic as it seems like you look for anchor tags twice and then use that as a condition for exiting your loop. Perhaps some debugging would help.
Also, is this your own project or a school project? If it is not something for school I'd recommend looking at using Apache Commons HttpClient for the client side stuff. It understands the HTTP protocol and can also handle SSL if you needed.
|
 |
|
|