$ in classname of runnable classes (threads)

I have an applet with a runnable subclass so that I can do processing in a thread rather than during paint.
This works fine but when compiling it generates a ".class" file with a $ in the name.
My main class is S2. The runnable subclass is "r". Compile generates S2.class and S2$r.class.
That's not a problem natively (on window 98) but I want to upload the classes to my ISP (@home) webspace.
Unfortunately, they do not allow $ in a file name.
Can I get javac to create the subclass in a file without the $ ?

I have an applet with a runnable subclass so that I
can do processing in a thread rather than during
paint.
This works fine but when compiling it generates a
".class" file with a $ in the name.
My main class is S2. The runnable subclass is "r".
Compile generates S2.class and S2$r.class.
That's not a problem natively (on window 98) but I
want to upload the classes to my ISP (@home)
webspace.
Unfortunately, they do not allow $ in a file name.
Can I get javac to create the subclass in a file
without the $ ?I do not believe it is possible to do eliminate the '$' fro inner class names. An alternative is to package the applet and its associated classes in a .jar. This eliminates the problem and can greatly improve applet load times.
Chuck

Similar Messages

  • Thread Pool Executor ( Runnable Class Executing another Runnable Class )

    Hi Folks,
    I have my main class called ThreadPoolExecutorUser. I have two Runnable classes called XYZ and ABC
    in ThreadPoolExecutorUser class I execute the Runnable class XYZ. Which inturn executes Runnable class ABC.
    The problem is that the Runnable class ABC is never executed ?. Can some one please explain what I am I doing wrong.
    _RB
    More Description Below :
    *public class ThreadPoolExecutorUser {*
    ThreadPoolExecutor dude = new ThreadPoolExecutor (.... );
    // I Execute the firest Runnable Xyz here
    dude.execute ( XYZ );
    Now I have two Runnable inner Classes
    *Class XYZ extends Runnable {*
    public void run () {
    s.o.p ( " I am in Xyz Runnable " );
    dude.execute ( ABC );
    *class ABC extends Runnable {*
    public void run () {
    s.o.p ( " I am in ABC Runnable " );
    }

    Hey folks.... Sorry its a typo in my e-mail. Sorry about that. I am pasting the actual code here.
    The problem again is that in the index function only FirstRunnable executes but not the SecondRunnable
    final public class Crawler {
        / create an instance of the ISSThreadPoolExecutor /
        private static ThreadPoolExecutor mythreadpoolexecutor = ThreadPoolExecutor.getInstance();
        / Constructor /
        / Index function /
        public void index( .... ) {
            :::::: code :::::::::
            // Execute this folder in a seperate thread.
            this.issthreadpoolexecutor.execute(new FirstRunnable(alpha, beta, gamma));
        / The Inner Class /
        class FirstRunnable implements Runnable {
            public FirstRunnable(int alpha, int beta, int gamma) {
            public void run() {
                            doSomething();
                            // Some other tasks and ...spawn of another thread.
                            issthreadpoolexecutor.execute(new SecondRunnable(a));
             // The Inner Class that Indexes the Folder
              class SecondRunnable implements Runnable {
                      private int ei;
                      public SecondRunnable ( int abc ) {
                            this.ei = abc;
                      public void run() {
                            doSomething ( ".....") ;
              } // End of SecondRunnable Class.
         } // End of FirstRunnable class.
    } // End of Crawler Class.

  • Runnable Vs Thread Class

    Hello All,
    I have a doubt regarding Runnable and Thread class. As we all know Java provides two ways to run Threads. One way is to extend Thread class and the other way is to implement Runnable Interface.
    Apart from the OOPS funda, does java have any other concept in providing two ways to run threads ?. I mean, we very well know that if we extend Thread class, we may not be able to extend any other class in Java . So if we implement Runnable interface,we can extend or implement any other Interface or class. Apart from this reason, does Java has any other concept in providing two ways to run threads ??
    Please share your knowledge
    Thanks and Have a Nice Day,
    Regds,
    Sai

    As far as I know, that's the only reason for the two options--one gives you flexibility in your class hierarchy, the other saves you a few lines of code. Personally, I always implement Runnable. The few lines of code saved seem trivial to me compared to "cleaner" OO (IMHO), but maybe somebody else has a better reason to extend Thread.

  • Updating a GUI component from a runnable class that doesn't know that GUI

    Hi. I have a problem that I think isn't solvable in an elegant way, but I'd like to get confirmation before I do it the dirty way.
    My application allows the user to save (and load) his work in sessions files. I implemented this by a serializable class "Session" that basically stores all the information that the user created or the settings he made in its member variables.
    Now, I obviously want the session files created by this to be as small as possible and therefore I made sure that no GUI components are stored in this class.
    When the user has made all his settings, he can basically "run" his project, which may last for a long time (minutes, hours or days, depending on what the user wants to do....). Therefore I need to update the GUI with information on the progress/outcome of the running project. This is not just a matter of updating one single GUI component, but of a dynamic number of different internal frames and panels. So I'd need a reference to a GUI component that knows all these subcomponents to run a method that does the update work.
    How do I do that? I cannot pass the reference to that component through the method's argument that "runs" the project, because that needs to be a seperate thread, meaning that the method is just the run() method of that thread which has no arguments (which I cannot modify if I'm not mistaken).
    So the only thing I can think of is passing the reference through the constructor of the runnable class (which in turn must be stored in the session because it contains critical information on the user's work). As a result, all components that need to be incorporated in that updating process would be part of the session and go into the exported file, which is exactly what I wanted to avoid.
    I hope this description makes sense...
    Thanks in advance!

    Thanks for the quick answer! Though to be honest I am not sure how it relates to my question. Which is probably my fault rather than yours :-)
    But sometimes all it takes me to solve my problem is posting it to a forum and reading it through again :)
    Now I wrote a seperate class "Runner" that extends thread and has the gui components as members (passed through its constructor). I create and start() that object in the run method of the original runnable class (which isn't runnable anymore) so I can pass the gui component reference through that run method's argument.
    Not sure if this is elegant, but at least it allows me to avoid saving gui components to the session file :-)
    I am realizing that probably this post shouldn't have gone into the swing forum...

  • How to get the message from a Runnable class

    The Schedule class is actually a JFrame, what I want to do is to "get" the message from Scheduler Class and display it in a JTextField, to let user know what is doing.
    How can I approach this?
    public class Schedule {
        @SuppressWarnings("static-access")
        public static void main(String args[]) throws InterruptedException {
            final Scheduler s = new Scheduler();
            Thread t = new Thread(s);
            t.start();
    public class Scheduler implements Runnable{
    private static int actionType;
    private static String msg;
        public static void setMsg(String msg) {
            Scheduler.msg = msg;
        public static String getMsg() {
            return msg;
        public void run() {
            //System.out.println((int)(Math.random() * 1000));
            actionType = 1;
            while(true){
                try {
                    switch(actionType){
                        case 1:
                            setMsg("Process actionType: "+actionType);
                            break;
                            case 2:
                            Thread.sleep(2000L);
                            setMsg("Process actionType: "+actionType);
                            break;
                            case 3:
                            Thread.sleep(2000L);
                            setMsg("Process actionType: "+actionType);
                            break;
                            case 4:
                            Thread.sleep(2000L);
                            setMsg("Process actionType: "+actionType);
                            break;
                    actionType++;
                    if(actionType>4){
                        actionType = 1;
                } catch (InterruptedException ex) {
                    System.out.println("Scheduler.run:"+ex.toString());
    }

    Or with only one loop:
            int actionType = 0;
            while (true)
                actionType = (actionType % 4) + 1;
                msg = "Process actionType: " + actionType;
                try
                    Thread.sleep(2000L);
                catch (InterruptedException ex)
                    System.out.println("Scheduler.run:" + ex.toString());
            }

  • Runnable a thread?

    Is a class that implements Runnable itself a thread?
    When i invoke run() method of a class that implements Runnable does it behave like a thread?
    Or only Runnable object wrapped by Thread class is a Thread?

    Is a class that implements Runnable itself a thread?Implementing Runnable is another way of writing threads, if you implement runnable you dont need to extend Thread, as a matter of fact it is considered the better way for writing threads. But thats another discussion
    >
    When i invoke run() method of a class that implements
    Runnable does it behave like a thread?
    use start
    class PrimeRun implements Runnable {
             long minPrime;
             PrimeRun(long minPrime) {
                 this.minPrime = minPrime;
             public void run() {
                 // compute primes larger than minPrime
    PrimeRun p = new PrimeRun(143);
         new Thread(p).start();

  • Runnable Class doubles memory need of application

    Hi
    I use a class called DisplayTimer to throw an event every second. This class is Runnable and runs as an own thread. Then I have OrientedText2D Object in a java3d environment that listen to these events and update their caption (countdown time) every time they receive an event. So far so good, the solution works. BUT the memory need of my application doubles when i .start() the Runnable DisplayTimer class to start the event-throwing for the countdown captions...
    Here is the DisplayTimer class:
    import java.util.*;
    import de.qtobe.events.*;
    import de.qtobe.tools.*;
    public class DisplayTimer implements Runnable {
        private List _listeners = new ArrayList();
        Thread t;
        public DisplayTimer() {
            t = new Thread(this);
            t.start();
        public void run() {
            while (true) {
                _fireUpdateNotificationEvent();
                //Runtime r = Runtime.getRuntime();
                //System.out.println("before: " + r.freeMemory());
                //r.gc();
                //System.out.println("after: " + r.freeMemory());
                try {
                    Thread.currentThread().sleep(900);
                } catch (java.lang.InterruptedException e) {
                    Log.log("Error in DisplayTimer occured.");
        public synchronized void addUpdateNotificationListener(UpdateNotificationListener l) {
            _listeners.add(l);
        public synchronized void removeMoodListener(UpdateNotificationListener l) {
            _listeners.remove(l);
        private synchronized void _fireUpdateNotificationEvent() {
            UpdateNotificationEvent updateNotification = new UpdateNotificationEvent(this, false);
            Iterator listeners = _listeners.iterator();
            while (listeners.hasNext()) {
                ((UpdateNotificationListener) listeners.next()).updateNotificationReceived(updateNotification);
            updateNotification = null;
            listeners = null;
    }This is how the listeners react:
        public void updateNotificationReceived(UpdateNotificationEvent event) {
                if (this.impactInfo != null) {
                    //Ausgabe kommt in die "Machine"
                    //String caption = "Remaining service time: " + this.impactInfo.getFormattedRemainingServiceTime();
                    //caption += ", Countdown to breach of contract: " + this.impactInfo.getFormattedCountdown();
                    String caption = "" + this.impactInfo.getFormattedCountdown();
                    caption += " (remaining fullfill time: " + this.impactInfo.getFormattedRemainingServiceTime() + ")";
                    this.setCaption(caption);
                    if (impactInfo.getCountdownBreachContract() <= 0) {
                        this.setCaptionColor(Def.COLOR_RED);
                    } else {
                        this.setCaptionColor(Def.COLOR_HOTRED);
                    caption = null;
                }The events transport no information or data btw.
    Does anyone have an idea how I can optimize this solution?
    Thanks in advance!

    The common understanding is that the swf is loaded into memory at once and in full, and so embedded assets take up initial memory based on how much they contribute to the SWF size even before any of them get instantiated into their runtime class form.  This is certainly the case for Android or desktops that use the SWF, it isn't clear if the native iOS compiling ends up treating the embedded assets memory footprint in the same way or not, but possible.
    There is a compiler flag which you can add called -size-report=report.xml that can give you a complete breakdown of how  each type of data within the SWF contributes to the size in compressed form. It is most likely this memory footprint that contributes to loading the SWF (independent of actually instantiating or hydrating any of the embedded assets).
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf67110-7ff4.html#WS19 f279b149e7481c45454d9412c561d3223-8000
    There most likely are others here that know more details or might even want to correct some of these assumptions, but that is why most mobile developers choose to load assets from the filesystem if possible as opposed to embedding assets to avoid the extra memory hit on the initial SWF loading into memory.

  • Help to find solution with class Thread.

    I have a program that needs some optimisation.
    public  void init()
            new Thread(new Proc1()).start();
            new Thread(new Proc2()).start();
            new Thread(new Proc3()).start();
            new Thread(new Proc4()).start();
       }Every ProcX does the same type of operations, for example
    class Proc1 extends Frame implements Runnable
          public void run()
           long t1=new Date().getTime();
           new Step1(0,3).pref();
           new Step2(3,0,0).pref();
           new Step2(7,4,4).pref();
           new Step3(0,4,0,1).pref();
           long t2=new Date().getTime();
           System.out.println("time1="+(t2-t1));
    class Proc2 extends Frame implements Runnable
            public void run()
          long t1=new Date().getTime();
          new Step1(4,7).pref();
          new Step2(3,1,1).pref();
          new Step2(7,5,5).pref();
          new Step3(5,8,2,3).pref();
          long t2=new Date().getTime();
          System.out.println("time2="+(t2-t1));
        }ets...
    The number of Steps is always the same for each Thread ProcX. But values in Steps are different, I want to make them variables.
    But there is a problem. I need to make an X number of ProcX, not only 4, and X must be a variable.
    In my dreams code should be smth like:
    public  void init()
        int X;
        for(X = 1; X = 10; X++){
              new Thread(new ProcX()).start();
    Do you have any idea about it? Or it's unreal?

    I have a program that needs some optimisation.
    public  void init()
    new Thread(new Proc1()).start();
    new Thread(new Proc2()).start();
    new Thread(new Proc3()).start();
    new Thread(new Proc4()).start();
    }Every ProcX does the same type of operations, for
    example
    class Proc1 extends Frame implements Runnable
    public void run()
    long t1=new Date().getTime();
    new Step1(0,3).pref();
    new Step2(3,0,0).pref();
    new Step2(7,4,4).pref();
    new Step3(0,4,0,1).pref();
    long t2=new Date().getTime();
    System.out.println("time1="+(t2-t1));
    class Proc2 extends Frame implements Runnable
    public void run()
    long t1=new Date().getTime();
    new Step1(4,7).pref();
    new Step2(3,1,1).pref();
    new Step2(7,5,5).pref();
    new Step3(5,8,2,3).pref();
    long t2=new Date().getTime();
    System.out.println("time2="+(t2-t1));ets...
    The number of Steps is always the same for each
    Thread ProcX. But values in Steps are different, I
    want to make them variables.
    But there is a problem. I need to make an X number of
    ProcX, not only 4, and X must be a variable.
    In my dreams code should be smth like:
    public  void init()
    int X;
    for(X = 1; X = 10; X++){
    new Thread(new ProcX()).start();
    de]
    Do you have any idea about it? Or it's unreal?well, why not just try your solution? ?

  • Diff bet Runnable and Thread

    Hi All,
    What is the major difference between Implementing Runnable interface and Extending Thread ?
    Thnx

    When you implement runnable, you can do nifty things like ... THIS:
    class Test implements Runnable {
         public static void main(String[] argv) {
              while( true ) new Thread(new Test()).start();
         public void run() {
              int i = 0;
              while( true ) {
                   i++;
                   System.out.print(i);
    }

  • Calling a method in Runnable Class

    Hello I am trying to water this down but how can I call a method in my class
    If I am passed only thread t.
    MyClass mc = new MyClass();
    Thread t = new Thread(mc);
    t.start(); //works because it is a method of Thread
    t.myMethodInMyClass (); // wont work because it cant find it
    I have attempted casting to MyClass but I get CCException.
    Any help would be wonderful..
    cheers and thanks in advance.
    Scott

    Well, you could potentially have too many things in one class. You may want to try and modularize your classes more. But 'if in several situations [you] need different things to run'... well, the logic is just going to have to be there for that in some form.
    Now, if you've already performed the logic to determine what to run and you are going to have to perform the logic again (in your run() method), then there is a flaw in your design.

  • Are static nested classes thread-safe?

    There doesn't seem to be any definitive answer to this. Given the following code, is it thread-safe?
    public class SomeMultiThreadedWebController {
    public HttpServletResponse someMethodToExecuteViaWebRequest(HttpServletRequest request) {
        simpleQueryBuilder("SELECT...").addParameter("asdf","asdf").createQuery(EMF.getEntityManager()).executeUpdate();
    protected static class SimpleQueryBuilder {
             private String queryString;
             private Map<String, Object> params = new HashMap<String, Object>();
             public SimpleQueryBuilder(String queryString) {
                  this.queryString = queryString;
             public SimpleQueryBuilder addParameter(String name, Object value) {
                  params.put(name, value);
                  return this;
             public Query createQuery(EntityManager em) {
                  Query query = em.createQuery(queryString);
                  for (Entry<String, Object> entry : params.entrySet()) {
                       query.setParameter(entry.getKey(), entry.getValue());
                  return query;
        public static SimpleQueryBuilder simpleQueryBuilder(String queryString) {
             return new SimpleQueryBuilder(queryString);
    }Forget whether or not someone would do this, as this is just an example. I'm really trying to get at whether or not the instance variables inside the static nested class are thread-safe. Thanks for any responses.

    Hello,
    I believe you understand what you're talking about, but you state it in a way that is very confusing for others.
    Let me correct this (essentially, incorrect uses of the terminology):
    I agree that thread-safe or not is for an operation, for a member, it has some sort of contextual confusion.
    Member has a much broader meaning in the [Java Language Specification|http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.4] . Even "class member" applies to both an attribute, a method, or an inner class or interface.
    I think you mean "member variable" of a class (aka "attribute" or "field"). By the way, static or not is irrelevant to the rest of the discussion.
    For an operation or a member, if there's only one thread could access it atomically in one moment, we could call it thread-safe.Mmm. I was tempted to say yes (I'm reluctant to commit myself). With an emphasis on "_The encapsulating class_ makes this member's usage thread-safe".
    Still, just synchronizing each operation on a member is not enough to make all usages "thread-safe":
    Consider a java.util.Vector: each add/get is synchronized, so it is atomic, fine.
    However if one thread adds several values, let's say 3, one by one, to a vector that initially contains 0 values, and another thread reads the vector's size() (another properly synchronized method), the reader thread may witness a size anywhere among 0, 1, 2, 3, which, depending on the business logic, may be a severely inconsistent state.
    The client code would have to make extra work (e.g. synchronizing on the vector's reference before the 3 adds) to guarantee that the usage is thread-safe.
    Thus any synchronized method(With the limit stated above)
    or immutable member (like primitive type) are thread-safe.
    Additionally for a member, if it's immutable, then it's thread-safe. You mean, immutable primitive type, or immutable object. As stated previously, an immutable reference to a mutable object isn't thread-safe.
    a static final HashMap still have thread-safe issue in practice because it's not a primitive.The underlined part is incorrect. A primitive may have thread-safety issues (unless it's immutable), and an object may not have such issues, depending on a number of factors.
    The put, get methods, which will be invoked probably, are not thread-safe although the reference to map is.Yes. And even if the put/get methods were synchronized, the client code could see consistency issues in a concurrent scenario, as demonstrated above.
    Additional considerations:
    1) read/write of primitive types are not necessarily atomic: section [ §17.7 of the JLS|http://java.sun.com/docs/books/jls/third_edition/html/memory.html#17.7] explicitly states that writing a long or double value (2 32-bits words) may not be atomic, and may be subject to consistency issues in a concurrent scenario.
    2) The Java Memory Model explicitly allows non-synchronized operations on non-volatile fields to be implemented in a "thread-unsafe" way by the JVM. Leading way to a lot of unintuitive problems such as the "Double-Checked Locking idiom is broken". Don't make clever guess on code execution path unless you properly synchronize access to variables across threads.
    Edited by: jduprez on Mar 4, 2010 9:53 AM

  • Are methods in the Graphics class Thread Safe

    Can methods from the Graphics class (.e.g. drawImage(), drawString(), ect..) be called from any thread? In other words, can two threads that refer to the same Graphics object step on each other methods calls?
    TIA,
    DB
    Edited by: Darth_Bane on Apr 27, 2009 1:44 PM

    No,
    They are GUI activities so you should call them from the Swing Thread ( Event Disptach Thread)
    Now for the JComponent the following are thread safe:
    repaint(), revalidate, invalidate which can be called from any thread.
    Also the listener list can be modified from any thread addListenerXX or removeListenerXX where XX is ListenerType
    Regards,
    Alan Mehio
    London, UK

  • Object Class -Thread

    Hai Respected Friend ,
    I have one doubt regarding Object Class. for what purpose the Object class has some methods like Notify(),Notify All(),wait() though we are not using those methods except with Thread class.
    why they are defined these methods in the Object Class ,why not in the Thread Class even though it is only useful with Thread Class.
    Please give clear ans.
    Thanks
    Selvakumar

    BigDaddyLoveHandles wrote:
    malcolmmc wrote:
    Actually, though these methods are useful only in a multi-threaded environment, no Thread objects are directly involved. What you need to specify isn't a thread object (the current thread is always the one affected) but the monitor, which can be any kind of Object.I would have been happy if they had defined a Lock class with wait and notify methods, because I prefer doing:
    public class C {
    private final Object lock = new Lock();
    public void method() {
    synchronized(lock) {...}
    }to
    public class C {
    public synchronized void method() {
    }In the second case, you have to contend with other code incorrectly calling wait/notify on an instance of C.
    So I don't see the win in these being java.lang.Object methods, other than allowing you to create one less object -- what an efficiency win ;-)However, there are times when it makes sense to expose the lock. For instance Collections.synchronizedXxx.

  • Another "could not find main class"  thread

    Hello everybody
    I know there's tons of threads on this subject but none of them seem to be quite like mine.
    I'm trying to deploy an application that I developped with Jbuilder 2006 Enterprise (trial version). It automatically created the "ServerApp.jar" file and the manifest but when I try to run it I get the famous message: "Could not find the main class. Program will exit." My main class is "Application" and it's in a package called "serverapp".
    here's a copy of my manifest:
    Manifest-Version: 1.0
    Main-Class: serverapp.Application
    it has two extra lines at the end.
    I read on the other threads that I also needed a .bat file (don't know quite why) so I created one. It looks like this:
    @ECHO ON
    Set Path = C:\Program Files\Java\jre1.5.0_04\bin
    cd C:\Documents and Settings\Naby\My Documents\Travail\Synapco\BlackeBerry\ServerApp
    javaw -jar ServerApp.jar
    EXIT
    One last thing: when I run the .jar file from the command line using the syntax
    java -jar serverapp.jar
    I get this more detailled error message:
    C:\Documents and Settings\Naby\My Documents\Travail\Synapco\BlackeBerry\ServerAp
    p>java -jar serverapp.jar
    Exception in thread "main" java.lang.SecurityException: no manifiest section for
    signature file entry javax/mail/internet/AsciiOutputStream.class
    at sun.security.util.SignatureFileVerifier.verifySection(SignatureFileVe
    rifier.java:377)
    at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVeri
    fier.java:231)
    at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier
    .java:176)
    at java.util.jar.JarVerifier.processEntry(JarVerifier.java:233)
    at java.util.jar.JarVerifier.update(JarVerifier.java:188)
    at java.util.jar.JarFile.initializeVerifier(JarFile.java:318)
    at java.util.jar.JarFile.getInputStream(JarFile.java:383)
    at sun.misc.URLClassPath$JarLoader$1.getInputStream(URLClassPath.java:62
    0)
    at sun.misc.Resource.cachedInputStream(Resource.java:58)
    at sun.misc.Resource.getByteBuffer(Resource.java:113)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:249)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    I don't know what is going on here.
    Any help would be really appreciated
    Thanks.

    Thanks for the reply martin
    what jar file are you refering to? I only have one jar file wich is "serverapp.jar" and that's the one I want to run.

  • Disposing of classes/threads

    I have a very interesting setup. I have
    Main class
    |_ Creates Sub class (Inside a vector)
    |_ Creates another class that extends thread and is start()ed
    |_ Creates another class that extends thread which restarts the above after it sleeps for 10 seconds.
    Now, the problem is this: Those classes never die. The two threaded classes run indefinitely, even after I remove the Sub Class from the vector. I heard that java will eventually destroy unused classes, but I'm not seeing that happen.
    The real confusing part. Sub Class has a variable "name". Now, after I remove the Sub Class from the Main Class, it will no longer find the value of "name" for what Sub Class was set to (What I expected); and yet the two thready classes continue to output stuff to the console..

    Yes, George is right, it's a vector of objects (Yes, I get confused between class/objects).
    - When I said "remove sub class from main class" I meant the vector, done with: vector.remove(#);
    - To find the name variable, I search through my entire vector (Players):
    int i=0;
              while(i<Players.size())
                   if(Players.get(i).name.equals("Apple"))
                        System.out.println("Found.");
                        i=Players.size();
                   i++;
              }After removing the object from the vector, an object with the name "Apple" is no longer found. (What I wanted)
    My two thread classes (For hopeful clarification)
    class PingThread extends Thread {
         int waittime;
         boolean finished=false;
         ConnectionHandler myParent;
         public PingThread(int wtime,ConnectionHandler parent)
              waittime=wtime;
              myParent=parent;
         public void run()
              try
                   System.out.println("[D] Beginning 60 sec wait");
                   this.sleep(waittime);
                   finished=true;
                   myParent.receivedPing=false;
                   myParent.sendData(6,"");
                   myParent.startPingTimer(); // This will create and start an object of PingWait
                   System.out.println("[D] Sending ping packet, initing 10 sec timer (End 60 sec)");
              catch(Exception e)
    class PingWait extends Thread {
         int waittime;
         boolean finished=false;
         ConnectionHandler myParent;
         public PingWait(int wtime,ConnectionHandler parent)
              waittime=wtime;
              myParent=parent;
         public void run()
              try
                   this.sleep(waittime);
                   finished=true;
                   if(!myParent.receivedPing) {
                        System.out.println("[D] Player did not respond to ping within 10 sec. Connection ended");
                        myParent.logout();
                   System.out.println("[D] 10 sec ping wait over.");
                   System.out.println("[D] Restarting 60 sec chk..");
                   myParent.clichk.run(); // This is an object of PingThread, it's already been start()ed, so I'm run()ing it. Works.
              catch(Exception e)
    }Now, knowing that you don't have the ConnectionHandler class (It's large, messy, etc etc.), I commented on the lines where the two thread classes relate to each other.
    What I want to stop happening is the above two classes from running indefinitely, hence hopefully having them destroyed and so they'll stop spamming my console and wasting memory.

Maybe you are looking for

  • How does  the Logical System GUID get created

    In R3 table CRMPRLS has a logical GUID for its logical system name.  How does this get created/updated?  Is it created during the initial replication of the data between R3 and CRM?   Why I am wondering is my systems where working ok in my QA environ

  • BPM doubt

    i have a BPM scenario i am callling 2 mappings inside it. i have made a change to 1 mapping. it worked fine in dev. wen i tranported to QA, the mapping is giveing some wrong value. Do we need to refresh the mapping inside the BPM in QA?

  • The menues are not appearing for me to work on a photo, even though the program has downloaded?

    The meues are not visable on the photoshop window to work on a photo.  I downloaded a bunch of photos to work on but all I can do is archive or rename.  How do I get to edit them? Where are the menues?  I downloaded the program and it is open.

  • Totalling a calculated field in end of report

    Hi I have a formula field (F087/F050) in the report Repetitive Area0 and I want to total the results of these line by line amounts in the 'End of Report' Please can someone explain how to compose the field I need in the End of Report Thanks Dom

  • Use catch block to do something other than handling exception?

    Hello, I have always been under the impression that the catch block should only handle the exception thrown by the try block? But now I'm reading a class where it's more or less used as an else if. Of course this works well, but I don't like it. What