Marine

Greenhorn
+ Follow
since Jan 25, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marine

ok , i'll change the name to Val Dra
sorry he is right on this , for some reason when i tried it i got an error before i guess it was a type. Sorry for misleading.
paul , only if it's a top level class other wise it's not allowed.
this is legit inner class example
Static declaration is not alloed unless it's upper class
<code>
public class t {
private class s {
final static int i = 0; // Error here
}
}
</code>
isn't that what i was saying at all ?
23 years ago
Hi , have you included the plugin along with your html file ? JApplet requires you to include a plugin. So if you haven't done that yet head on to sun and download htmlConverter. In a search type in converter and it will give you a link fora download. Then you open that program and tell it to use the html file that you wish to convert which has the applet tags in it. After that it will generate an html file for you with a plugin contents. Then you will be able to run it. However there is a drawback to this. Users which don't have it yet will have to download about 5 megs before displaying your applet. Good Luck
23 years ago
that's precisely why it should be used. If your array size might change you don't have to keep the hard coded number , in any case it won't be the right one. So the length variable will always have the right number of elements to tell you about.
23 years ago
sure , drawString is a static method of Graphics class. Which outputs a string in a specified coordiante position of your container. simple example would be this i am using an applet to show this
<code>
import java.applet.*;
import java.awt.*;
public class DrawString extends Applet {
public void paint(Graphics g) {
g.drawString("Your String",50,50); // Coordinates tells where the string will appear.
}
}
</code>
i can't catch anything particular but is numberOfWords an array or a variable that contains a length of the array elements stored in it ? Other wise change it to numberOfWords.length
also your "/t" should be "\t"
23 years ago
private static void main
is a known bug it's been documented on sun page i remember reading it there about it.
******************************************
Marine
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.
[This message has been edited by Cindy Glass (edited January 27, 2001).]
[This message has been edited by Cindy Glass (edited January 27, 2001).]
23 years ago
while you do this
t.run()
there is nothing wrong with that. but what you infact do is you fire the method to be executed. But it's not a thread that get's the work done for you. At least not the one that you are thinking is running right now. The code runs and prints whatever you have there. But what does the work is the thread that runs your applet in a browser. So the start() method makes the thread to run . the thread that you created.
can you please email a link to his exam. Thank you or post it here
email: crutoy@aol.com
23 years ago
so what exactly is your question ? You are right checked exceptions are the once that are declared in throws clause. It becomes more interesting when you sublass a class which has a method that has checked exceptions declared. Now when you override that method you cannot declare any other exceptions in a trows clause because a superclass does not allow you to do so. But if you overload that method you are allowed to add as many as you'd like. I don't know if this helps you in any way.
23 years ago
so what exactly is your question ? You are right checked exceptions are the once that are declared in throws clause. It becomes more interesting when you sublass a class which has a method that has checked exceptions declared. Now when you override that method you cannot declare any other exceptions in a trows clause because a superclass does not allow you to do so. But if you overload that method you are allowed to add as many as you'd like. I don't know if this helps you in any way.
i don't understand ? what do you mean ? Am i not allowed to use the name Marine ?