Threading doubt

Sir, i have a small doubt in multithreading,
My program is compling but if i run the error is
"Exception in thread main java.land no such method Error: main.
Kindly rectify the problem

You should provide a little more information. Were you trying to run an application?
For example, if you tried to run an application and you used "java MyClass" then the error could occur if the MyClass class does not have a method whose signature is exactly public static void main(String[] args)

Similar Messages

  • Java Thread doubt

    i am having a code where i call notify(), but it notifies all the thread.. (i am not using notifyAll() ). please tell me what is the problem ... the code snippet is below
    class Waiter extends Thread
         Object n;
         public Waiter(Object not){
              this.n=not;
         public void run(){
              synchronized (n){
                   try{
                        System.out.println("before wait");
                        n.wait(4000);
                        System.out.println("after wait");
                   catch(InterruptedException ie){ie.printStackTrace();}
    class Notifier extends Thread{
         public void run(){
              synchronized(this){
                   System.out.println("Notifying");
                   notify();
    public class MainClassForThreads
         public static void main (String a[])
         Notifier n= new Notifier();
         //Object n = new Object();
         new Waiter(n).start();
         new Waiter(n).start();
         new Waiter(n).start();
         new Waiter(n).start();
    n.start();
    }

    BillJistson:
    Please use code tags when posting (more than a few lines of) source code (http://forum.java.sun.com/help.jspa?sec=formatting ).
    I'm also not aware that this is specified somewhere. Probably one of those spurious wakeups as mentioned in the JLS etc.?
    http://java.sun.com/docs/books/jls/third_edition/html/memory.html#17.8.1
    Whatever it turns out to be, the problems encountered here are due to a (common) bad practice: it is strongly recommended not only in Object.wait()'s Javadoc http://java.sun.com/javase/6/docs/api/java/lang/Object.html#wait() to always use a "wakeup" condition combined with a loop. If you do that, your example code works even when synchronizing on the Thread object itself (if you think that's necessary). But from a quick experiment it seems that the Notifier thread object notifyAll()'s/interrupts(?) all waiters periodically on my machine, and it's probably advisable to just use a dedicated monitor object if there isn't some other obvious synchronization instance...
    EDIT: Me dumb, I forgot that wait(4000)... just ignore the last sentence above. A Thread instance should be equally suited as a monitor as any other Object. I'm sorry if this caused confusion.
    See also: Spurios wakeups of Object.wait() ???
    http://forum.java.sun.com/thread.jspa?threadID=5206579
    Message was edited (2x, sorry) by:
    oebert: clarification/correction

  • Thread doubt

    Iam creating thread array to invoke the n number of thread..... if any one of the thread in the array died i need to start the thread newly and add to the thread array... can anyone how to do this implementation.....?

    Hi ,
    If I get you right you can just check wheather the thread is alive or not by
    isAlive() method and you can start a new thread depending on the output.
    Thanks & Regards
    Pradeep

  • How to delete the master data of a Customer created in a SALES AREA?

    Hi All,
    I've deleted a Customer (master data) by t.code OBR2. But it exists again in its SALES AREA.
    Could anyone tell me how to delete it in the sales area too?
    Thanks

    Hi,
    I dont think you can delete a customer. you can market it for deletion in XD06.
    for deleting customer master data you have to setup an archiving project.
    Also check the similar thread
    doubt in obr2
    Hope it helps you.
    Regards,
    Sats.

  • Endevo GOOP300 , Endevo LabviewNative , OpenG100

    Hi, Can you please explain the difference between these three? In my PC, it is defaulted to Endevo GOOP300.What exactly it is? Which one should I use?  Thanks in advanceRamUsing LabVIEW 8.5 - Endevo GOOP 2.0   

    Hi mathan,
    Can you tell how both the thread would be same ? in my secaond thread i asked about the different class providers ?
    and which should i use ?
    In first , i asked about the Class object repository ? ok thats not the problem ,
    can you solve my first thread doubts ?
    Thanks
    Ram

  • GRC Architecture

    Can some one explain the functionality of GRC as far as risk management is concerned. What is the architecture?

    Which GRC product are you referring to? You can see a quick highlight of the products in a previous thread (doubt on ccg and pcg
    Also you can visit http://www.oracle.com/grc and go through the solutions on the left hand column.

  • Doubt in thread handling

    I have a doubt in the thread mechanism.....
    Below is a sample of the class
    public class SimpleThread extends Thread {
    private int countDown = 5;
    private static int threadCount = 0;
    public SimpleThread() {
    super("" + ++threadCount); // Store the thread name
    start();
    public String toString() {
    return "#" + getName() + ": " + countDown;
    public void run() {
    while(true) {
    System.out.println(this);
    if(--countDown == 0) return;
    public static void main(String[] args) {
    for(int i = 0; i < 5; i++)
    new SimpleThread();
    There is a while loop checks for true.... I am not able to understand which it is referring to .
    and i want to run the thread 5 times .... is it possible to run this using while loop... Because when i use while the loop never end...
    Your guidance is much more appreciated...
    Thankyou
    Shasi

    Hi,
    sorry, but your question seems to be a little confusing.
    shasi wrote:
    I have a doubt in the thread mechanism.....Do you actually have a doubt or more something of a question? To me, it seems to be more of a question...
    Below is a sample of the classPlease use the code tags to format your code for better readability...
    public class SimpleThread extends Thread {
         private int countDown = 5;
         private static int threadCount = 0;
         public SimpleThread() {
              super("" + ++threadCount); // Store the thread name
              start();
         public String toString() {
              return "#" + getName() + ": " + countDown;
         public void run() {
              while(true) {
                   System.out.println(this);
                   if(--countDown == 0) return;
         public static void main(String[] args) {
              for(int i = 0; i < 5; i++)
                   new SimpleThread();
    There is a while loop checks for true.... I am not able to understand which it is referring to .What should it be referring to? The while loop has to be given some statement that evaluates to a boolean. This could either be something like a > 10 or simply true.
    and i want to run the thread 5 times .... is it possible to run this using while loop... Because when i use while the loop never end...You do run the Thread five times. Or are you talking about executing the loop in your run() method for five times (which you also happen to do already)?
    What do you want to run using a while loop?
    The while loop will end: with each iteration, your countdown variable is being decremented, and as soon as it reaches zero, the return statement is executed breaking out of the while loop.
    Bye.

  • Doubt in posting thread

    in which category i can post J2ME threads? please reply i have several doubt in J2ME concepts. i want to post many threads related to J2ME.

    There are no J2ME forums on OTN - you can try http://www.j2meforums.com/forum/ perhaps

  • I have a doubt about The Single-Thread Rule

    The [url http://java.sun.com/docs/books/tutorial/uiswing/overview/threads.html#rule]Single Thread Rule states:
    Rule: Once a Swing component has been realized, all code that might affect or depend on the state of that component should be executed in the event-dispatching thread.
    I began to wonder about this because so much code seems to work just fine when it isn't executed in the event dispatching thread. Why are there exceptions? I went looking for some code which acted differently when executed on the event thread than when it was not. I found this
    http://forum.java.sun.com/thread.jsp?forum=57&thread=410423&message=1803725#1803725
    Now I started wondering why this was the case. What I found was that DefaultCaret adds a document listener to the document of the JTextComponent. In this listener, the insertUpdate() method specifically tests if it is running on the event dispatch thread and if it is, it updates the caret position.public void insertUpdate(DocumentEvent e) {
        if (async || SwingUtilities.isEventDispatchThread()) {
            // ... update the caret position ...
    }I then copied the code from DefaultCaret and made a MyCaret. I needed to tweek the code a little bit, but it ran. I removed the event thread test. It worked outside the event thread. There was a small difference in the results though. The textarea did not scroll all the way to the bottom. Almost, but not quite. I didn't test enough to make sure this was the only problem, but there was at least one problem.
    Now I started think about why this would be. The thought crossed my mind that the order of the events which were posted to the event queue were probably important. Sun found bugs when components were updated out of the event thread, so they essentially ignored events which weren't on the event thread and created the The Single-Thread Rule.
    A few days pass. I'm starting to wonder if Sun could have done a better job making Swing components thread safe. I also don't know that this specific case I found was the rule or the exception to the rule. But without insight into the design philosopy of Swing, I would have to examine all their components and see how they have written them and see if I can come up with a better design. That sound like a lot of work. Especially without getting paid for it.
    But wait a second, all you have to do is call the append() method of JTextArea on the event thread. If that is the case, why didn't they write the freakin component that way? Well, I'll try itclass MyTextArea extends JTextArea {
      public MyTextArea(int rows, int columns) { super(rows,columns); }
      public void append(final String text) {
        if (SwingUtilities.isEventDispatchThread()) super.append(text);
        else {
          SwingUtilities.invokeLater(new Runnable() {
            public void run() { myAppend(text); }
      private void myAppend(String text) { super.append(text); }
    }I change [url http://forum.java.sun.com/thread.jsp?forum=57&thread=410423&message=1803725#1803725]camickr's code to use a MyTextArea and it works fine without calling from the event thread. I've essentially moved The Single-Thread Rule to the component itself rather than relying on each and every one of the [url http://www.aboutlegacycoding.com/default.htm?AURL=%2FSurveys%2FSurvey6intro%2Easp]2.5 million Java programmers worldwide to use SwingUtilities.invaokeLater().
    Now for my question...
    Why didn't Sun do this?

    Swing is slow enough as it is. Lets not make it slower
    just
    because dense "programmers" don't know what they are
    doing.I agree with you in defending the current model, but aren't you a bit harsh there?!? ;-)
    Well, there are a number of not-so-dense programmers that expect such high-level components to be thread-safe. The question is worth asking whether Sun intentionally favor the explicit thread management for performance reasons, or whether this was an oversight.
    I'd go for the former (intentional) : indeed any GUI toolkit is inherently thread-based; there is always a distinction between the graphical thread(s) and the application threads - and the programmer always has to manage explicit thread creation to handle long-running event handlers without blocking the event dispatching thread. Extending thread concerns to the updating of components is therefore not a big move.
    So it seems fair that a core GUI toolkit does not hide thread issues (though to the best of my knowledge there is no such limitation in updating AWT components), or at least that's what Sun deemed.
    An ease-of-use-focused toolkit wrapping the core toolkit for thread-safety can be provided as a third-party product. Though I agree that wrapping the dozens of existing widgets and hundreds of methods is cumbersome - and the lack of such products probably shows it would have a low added value to trained developpers.
    Because your way is an extra method call and if
    statement, neither of which is necessary if you already know you
    are in the correct thread. Now count the number of methods
    which will need to be changed (and add up the extra cost).Indeed it's quite common to update several properties of several widgets in one bulk (when user clicks "OK", add a row to the table, change the title of the window, update status bar, re-enable all buttons, change some color,...).
    In this case explicit thread management doesn't spare one if but a dozen of redundant ifs!
    Note that there could have been if-less ways to cope for thread safety, such as creating a copy of the component's model when a change is made to a component, and switching the model only before paint() is called in the event-dispatching - of course coalescing all changes into the same "updated" model until paint() is called.
    But this would trade ease of use for redundant memory consumption, especially for some components with potentially huge models (JTree, JTable, JTextArea,...). And Swing appears to be already quite memory-greedy!

  • One doubt on threads

    Hi Techies,
    Actually I am having one problem with TableModel and Threads. I have one server application which creates one thread for each client. It has one table that contains one row representing details of one client connection. It adds or deletes one row when client make or close connection with server respectively. The data is fed into the table through a list. The list is updated as a connection is added or lost. Here the server class has one static variable which will be incremented when ever any client closes the connection. It works fine when the clients are closed with some interval between them. But when two or more clients close the connection quickly, then the table shows corrupted data. One row data will appear in two rows. I think even before the other threads are updated themselves for first closed connection, the second connection close causes the data to be corrupted. I think there is some problem of multi threading. Can any one suggest any solution or guidance for this?
    Edited by: JavaBreather on 18 Apr, 2009 4:33 PM

    JavaBreather wrote:
    Hi Techies,
    Actually I am having one problem with TableModel and Threads. I have one server application which creates one thread for each client. It has one table that contains one row representing details of one client connection. It adds or deletes one row when client make or close connection with server respectively. The data is fed into the table through a list. The list is updated as a connection is added or lost. Here the server class has one static variable which will be incremented when ever any client closes the connection. It works fine when the clients are closed with some interval between them. But when two or more clients close the connection quickly, then the table shows corrupted data. One row data will appear in two rows. I think even before the other threads are updated themselves for first closed connection, the second connection close causes the data to be corrupted. I think there is some problem of multi threading. Can any one suggest any solution or guidance for this?
    Edited by: JavaBreather on 18 Apr, 2009 4:33 PMI guess your code needs some kind of synchronization (synchronized) block. Either use synchronized list (even though I don't prefer this) or synchronize the block of code (operation) which updates table data.

  • Thread safe doubt

    Hi every1
    My question:
    Multiple threads enter the method att()...i want to count how much time does attacher.attach() method takes for every thread that comes in...i think the code below works... but if i declared the timeTakenForAttach as global variable..someone told me its not thread safe...can some1 please explain me the meaning of all this OR can i declare timeTakenForAttach as global and it won't be a problem..
    class A{
      long totalAttachSetupMillis=0L;
      public void att() {
          long start = System.currentTimeMillis();
                   attacher.attach();
          long timeTakenForAttach = System.currentTimeMillis() - start;
           recordAttachSuccess (timeTakenForAttach);
       public synchronized void recordAttachSuccess(long timeForAttach){
                totalAttachSetupMillis += timeForAttach;
    }Thankyou..

    javanewbie83 wrote:
    I have to sychronize record sucess as different threads would enter att() and enter record success method and simultaneously update, so i will end up getting a wrong value.Let me give you a more detailed explanation of why NOT having it synchronized would not work.
    First of all, let's take a look at the statement of concern:
    totalAttachSetupMillis += timeForAttach;For the purposes of synchronization, however, we need to look at it like this:
    int temp = totalAttachSetupMillis + timeForAttach; //call this LINE A
    totalAttachSetupMillis = temp; //call this LINE BNow, lets say we had threads named 1 and 2. If you didn't sychronize the method, you could possibly have this execution flow:
    //initial values: totalAttachSetupMillis = 0, timeForAttack(1) = 20, timeForAttack(2) = 30.  Total should be 50
    1A //temp(1) = 0 + 20 = 20
    2A //temp(2) = 0 + 30 = 30 (remember totalAttachSetupMillis isn't set until B)
    2B //totalAttachSetupMillis = temp(2) = 30
    1B //totalAttachSetupMillis = temp(1) = 20 (instead of 50)In other words, total disaster could possibly ensue. Which is why you wanted to synchronize it. Ed's explanation of your other question was right on the money, though.

  • Doubt in AXIS-Exception in thread "main" . how can i run this program

    hi
    I am new to axis., I done few webservice program using Jwsdp
    i can't resolve the reason for this exception.
    I have set all the classpath and other path variable that is necessary for axis .,
    I got this example from http://javaboutique.internet.com/tutorials/Axis/index.html
    Can any one help to solve this problem.,
    **************Code***************
    import java.util.*;
    public class NHLService {
      HashMap standings = new HashMap();
      public NHLService() {
        // NHL - part of the standings as per 04/07/2002
        standings.put("atlantic/philadelphia", "1");
        standings.put("atlantic/ny islanders", "2");
        standings.put("atlantic/new jersey", "3");
        standings.put("central/detroit", "1");
        standings.put("central/chicago", "2");
        standings.put("central/st.louis", "3");
      public String getCurrentPosition(String division, String team) {
        String p = (String)standings.get(division + '/' + team);
        return (p == null) ? "Team not found" : p;
    package hansen.playground;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import javax.xml.rpc.namespace.QName;
    import java.net.*;
    public class NHLServiceClient {
       public static void main(String [] args) throws Exception {
           Service service = new Service();
           Call call = (Call)service.createCall();
           String endpoint = "http://localhost:8081/axis/NHLService.jws";
           call.setTargetEndpointAddress(new URL(endpoint));
           call.setOperationName(new QName("getCurrentPosition"));
           String division = args[0];
           String team = args[1];
           String position =
             (String)call.invoke(new Object [] {new String(division), new String(team)});
           System.out.println("Got result : " + position);
    }************ classpath***************
    :/home/sujithkr/webservices/xml-axis/java:
    /home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/axis.jar
    /home/sujithkr/webservices/xml-axis/lib/activation.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/clutil.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/commons-logging.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/jaxrpc.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/log4j-core.jar
    :/home/sujithkr/webservices/xml-axis/webapps/axis/WEB-INF/lib/tt-bytecode.jar
    ********************Error Report*******************************
    java hansen.playground.NHLServiceClient atlantic philadelphia
    Exception in thread "main" Error while compiling: /usr/local/tomcat/webapps/axis//NHLService.java
    at org.apache.axis.message.SOAPFaultBuilder.endElement(Unknown Source)
    at org.apache.axis.encoding.DeserializationContextImpl.endElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    at org.apache.axis.encoding.DeserializationContextImpl.parse(Unknown Source)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at hansen.playground.NHLServiceClient.main(NHLServiceClient.java:21)
    suse-1:/home/sujithkr/webservices # clear
    suse-1:/home/sujithkr/webservices # java hansen.playground.NHLServiceClient atlantic philadelphia
    Exception in thread "main" Error while compiling: /usr/local/tomcat/webapps/axis//NHLService.java
    at org.apache.axis.message.SOAPFaultBuilder.endElement(Unknown Source)
    at org.apache.axis.encoding.DeserializationContextImpl.endElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    at org.apache.axis.encoding.DeserializationContextImpl.parse(Unknown Source)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at org.apache.axis.client.Call.invoke(Unknown Source)
    at hansen.playground.NHLServiceClient.main(NHLServiceClient.java:21)
    thank you for helping me in your hectic schedule....

    Please post your code using code tags.
    When I try to compile or build i cant.What is your question? Exactly what error message do you get?

  • MDB / threads allocation : doubt

              Hello Tom,
              you wrote that :
              "Remember that an MDB will use up to half+1 of the thread pool."
              Sorry, but I've not understood.
              Do you mean that, if I have one MDB, 12 available threads (considering 3 threads
              for container's activities), I can have a max concurrency of 6+1 MDB executing
              I've implemented a simple MDB with a sleep inside.
              I've sent 12 messages to the destination (queue).
              All 12 threads have been "occupied" by the MDBs (and the 13th message is not processed,
              until one of the 12 MDBs wakes up), and I've not seen this limit (half+1).
              Please can you explain ?
              Thanks in advance
              Sergi
              

              Thanks Tom !
              Sergi
              Tom Barnes <[email protected]> wrote:
              >
              >Sergi Vaz wrote:
              >> Hello Tom,
              >> thanks for the reply.
              >>
              >> I've done my test with 6.1sp4, and I did not see this limit (I've occupied
              >all
              >> threads with MDBs waiting in the default queue).
              >>
              >> I've verified it with a thread dump.
              >>
              >> What have I done wrong ?
              >
              >Nothing. The internal tracking system I consulted
              >stated that the limit was added in SP4, but
              >it didn't make it in until SP5. This time
              >I checked the actual source code. Sorry about
              >the confusion. For now, just set
              >"max-beans-in-free-pool" to limit the concurrency.
              >
              >Tom
              >
              >
              >>
              >> Thanks in advance
              >>
              >> Sergi
              >>
              >>
              >>
              >> Tom Barnes <[email protected]> wrote:
              >>
              >>>Hi Sergi,
              >>>
              >>>It turns out that the "half+1" MDB thread usage
              >>>limit was put in effect in 6.1SP4, 7.0SP1, and 8.1.
              >>>In previous versions, I highly
              >>>recommend setting the MDB's "max-beans-in-free-pool"
              >>>to something reasonably smaller than the default execute thread
              >>>pool size to help prevent possible dead locks.
              >>>
              >>>To provide more control, 7.0SP? and 8.1 allow you to
              >>>specify "dispatch-policy" in the weblogic descriptor xml
              >>>to cause the MDB run in a thread pool you
              >>>have configured. In which case the "half-plus-one"
              >>>limit is not imposed.
              >>>
              >>>Tom
              >>>
              >>>Sergi Vaz wrote:
              >>>
              >>>>Hello Tom,
              >>>>
              >>>>you wrote that :
              >>>>
              >>>>"Remember that an MDB will use up to half+1 of the thread pool."
              >>>>
              >>>>Sorry, but I've not understood.
              >>>>
              >>>>Do you mean that, if I have one MDB, 12 available threads (considering
              >>>
              >>>3 threads
              >>>
              >>>>for container's activities), I can have a max concurrency of 6+1 MDB
              >>>
              >>>executing
              >>>
              >>>>?
              >>>>
              >>>>I've implemented a simple MDB with a sleep inside.
              >>>>I've sent 12 messages to the destination (queue).
              >>>>
              >>>>All 12 threads have been "occupied" by the MDBs (and the 13th message
              >>>
              >>>is not processed,
              >>>
              >>>>until one of the 12 MDBs wakes up), and I've not seen this limit (half+1).
              >>>>
              >>>>Please can you explain ?
              >>>>
              >>>>Thanks in advance
              >>>>
              >>>>Sergi
              >>>>
              >>>>
              >>>>
              >>>
              >>
              >
              

  • Doubt regarding on Thread

    I need to knw how to handle the thread exception?Is it possible to start the new thread when the thread crashes...? can any one give me the source code for how to handle the exception in thread related with socket concept.....?

    Well, there's complex stuff involving putting handlers into a ThreadGroup for unhandled exceptions, but it's generally simpler just to put a perfectly ordinary try - catch block in your run() method.

  • Doubt about threads

    Hai
    Is it possible by the use of threads to run two processes concurrently( i mean in the literal sense that two processes need to run at the same time) ?
    Thank you

    Depends. If you mean really at the same time, yes, but you need the hardware support for that. If you mean time slices or something, then yes, that's what threads are there for, anyway.

Maybe you are looking for