Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

background

Posted on 1999-07-25
3
Medium Priority
?
291 Views
Last Modified: 2012-08-13
Hi,

 How to create a background process in java?
0
Comment
Question by:manjucee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
poloi earned 300 total points
ID: 1247058
// the first process
public class TheProcess1 implements Runnable {

           public TheProcess1() {

          // construct something
          }

            public void run() {

            .... Your task 1 here

            }

}

// the second process
public class TheProcess2 implements Runnable {
            public TheProcess2() {
                     .... construct something
            }

            public void run() {
                   .... your task 2 here

            }



// start program
public class MyProgram {

              public static void main(String args[]) {
 
                      TheProcess1 p1;
                      TheProcess2 p2;

                     // initialize the objects
                     p1=new TheProcess1();
                     p2=new TheProcess2();

                    // start process1
                   Thread t1=new Thread(p1);
                   t1.start();        // it will call p1.run()

                   // start process2
                  Thread t2=new Thread(p2);
                  t2.start();       // it will call p2.run()


...... now they are running concurrently.

          }
}
0
 

Expert Comment

by:poloi
ID: 1247059
oh sorry i have missed a BRACE  "}" at the end of process 2 code.
0
 

Author Comment

by:manjucee
ID: 1247060
Hi ,
       Since i was in urgent i didn't given full info.

   What excatly i want is, I have connected to ISP through exchange.
no i want to send some pulses to Exchange ,along with the data(Iam browsing).
using JTAPI . It need not be Background process.
Regards
manju
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question