Friday, May 2, 2008

Java difference between thread start vs run methods

It is very impotent to know the difference between thread start run methods. both will executes the same run method. There is some very small but important difference between using start() and run() methods. Look at two examples below:

The result of running examples will be different.

Example : 1

Thread one = new Thread();
Thread two = new Thread();
one.run();
two.run();

In This Example  the threads will run sequentially: first, thread number one runs, when it exits the thread number two starts.

Example : 2

Thread one = new Thread();
Thread two = new Thread();
one.start();
two.start();

In This Example   both threads start and run simultaneously.

Example : 3

public class TesTwo extends Thread {
    public static void main(String[] args) throws Exception{
        TesTwo t=new TesTwo();
        t.start();   
        t.run();
        doIt();       
    }
public void run()

{
    System.out .println("Run");
}
    private static void doIt()

{
        System.out.println("doit. ");
    }
}

Output:

Run
Run
doit.

In this example the start(public void run())  and run methods will executes simultaneously.Because after execution of start statement there are two simultaneous ways.

           t.start(); 

      clip_image002clip_image001

t.run();      public void run()

the two lines will executes simultaneous . so the output will print Run Run in output. after completion of public void run method then controller will return to doIt method. At last the method do It will execute.

Example : 4

public class TesTwo extends Thread {
    public static void main(String[] args) throws Exception{
        TesTwo t=new TesTwo();       
        t.run();
        t.start();
        doIt();       
    }
public void run(){
    System.out .println("Run");
}
    private static void doIt() {
        // TODO Auto-generated method stub
        System.out.println("doit. ");
    }
}

Output:

Run
doit.
Run

In this example the  run method will executes synchronously.so the in output it prints first line  "Run". Next start and doit methods will executes simultaneously.Because after execution of start statement there are two simultaneous ways.

           t.start();  

      clip_image002clip_image001

doIt();      public void run()

the two lines will executes simultaneous . so the output will print " doit. Run" in output second and third line.

Conclusion: The start() method call run() method asynchronously does not wait for any result, just fire up an action), while we run run() method synchronously - we wait when it quits and only then we can run the next line of our code.

Start()--> asynchronous.

run() -->synchronous.

Sunday, April 27, 2008

JNTU Btech Online Bits, Previous Question papers, all in one, Books Download

Hi

i have collected all JNTU B.Tech (ECE, CSE,EEE,IT,MECH)Online Bits and Previous Question Papers of all years(1st year, 2nd year, 3rd year,4th year)

Jntu Btech 1ST year ECE ONLINE BITS

I year previous Question Papers:

R05AprilMay2007-IB.Tech

BEE ------ Click Here
CDS ------ Click Here
EDC ------ Click Here
NA ------ Click Here
AP ------- Click Here

I year Online Bits:

APPLIED PHYSICS ------> CLICK HERE TO DOWNLOAD
C & DS ------------------> CLICK HERE TO DOWNLOAD
EDC ---------------------> CLICK HERE TO DOWNLOAD
M 1----------------------> CLICK HERE TO DOWNLOAD
ENGLISH ----------------> CLICK HERE TO DOWNLOAD
MM ----------------------> CLICK HERE TO DOWNLOAd
NT -----------------------> CLICK HERE TO DOWNLOAD

New Physics
BEEE
EDC
C&DS
BEE
MM
ENGLISH
M1

                      OR DOWNLOAD FROM

Download Jawaharlal Technological University (JNTU) Online Bits 1st year 2007,,, all 60 sets
C & D S
http://share.urbangen.com/265199-cds.rar
Applied Physics
http://share.urbangen.com/874974-aphy.rar
English
http://share.urbangen.com/668771-english.rar
Mathematics1
http://share.urbangen.com/213248-Mathematics1.rar
Mathematical Methods
http://share.urbangen.com/362052-mm.zip
EDC,BEE&NA
http://share.urbangen.com/753520-Nabeeedc.rar

Jntu online bits for 2007-Mathematics1-set1 

 

   Jntu 2nd year Online Papers and bits

II year previous Question Papers:

E.C.E
A.C -
Download
S.T.L.D - Download
E.M.T.L. - Download
E.T. - Download
JAVA - Download
C.S - Download

C.S.E and  IT

 

DAA - Download
ES - Download

JAVA - Download
MP - Download
PC - Download
ET - Download
STLD - Download
ES - Download

 

2-2 CSE/IT

CSE 2-2

R05AprilMay2007-IIB.TechIISem

R05AugSept2007-IIB.TechIISem

CSE II yr Online-2 papers SendSpace Link
Password : jagan.co.nr
ECE II yr Online-2 papers SendSpace Link
EEE II yr Online-2 papers SendSpace Link
MECH II yr Online-2 papers SendSpace Link
IT II yr Onlie-2 papers SendSpace Link

2-1 ECE EXTERNAL PAPERS

external_examination_papers_IIyear_STUDENTSHANGOUT.COM.rar

II year Online Bits:
JNTU 2-2 online bits for CSE,IT,ECE
Download:
MP
POC
JAVA
ES
PTSP
Btech ECE 2yr - II sem Bits

2-2 jntu online bitss for ECE

2-2 jntu online bits single file
JNTU ONLINE BITS For 2-2 2nd mid exams cse 

B.TECH 2-2 ONLINE BITS

2-2 CSE/IT

ET:-
CS:-
EMTL:-
AC:-
DAA:-
STLD:-
OOPS:-

ALL 2-2 2ND MID ONLINE BITS FOR CSE/IT ,ECE ALL SUBJECTS BY JUST ONE NEW CLICK


CSE&IT
ECE


2-2 2ND MID ONLINE BITS FOR CSE/IT ,REALLY ITS WORKING AFTER TESTING ONLY I KEPT HERE


SE
ES
JAVA
DAA
CG
MP


Jntu Btech 3rd year Online Papers and Bits

III year previous Question Papers:

  • RRAugSept2007-IIIB.TechIISems
  • RRAprilMay2007-IIIB.TechIISem

    CSE
    Unix - Download
    CD - Download
    CG - Download
    ECE
    M.W. - Download

    EEE
    CS - Download

    MEFA - Download

     

    CSE III yr Online-2 papers Direct Link (4 papers same for i.t. also)
    ECE III yr Online-2 papers Direct Link
    EEE III yr Online-2 papers Direct Link
    MECH III yr Online-2 papers SendSpace Link

    Password : jagan.co.nr

    Old papers

    CSE 3-2

    ECE 3-2

    EEE 3-2

    MECH 3-2

     

    III year Online Bits:

    3-2IT
    3-2 CSE

    3-2 CSE 2ND MID ONLINE BITS,MORE THAN 15 SETS FOR
    INFORMATION SECURITY
    COMPUTER GRAPHICS
    NEURAL NETWORKS
    COMPILER DESIGN
    STM

    JNTU 3-2 ONLINE BITS FOR CSE & IT
    25-30 PAPERS ARE AVAILABLE FOR EACH SUBJECT
    UNIX:
    STM
    NEURAL NETWORKS:
    INFORMATION SECURITY:
    COMPILER DESIGN:

       3-2 ECE ONLINE BITS BASED ON NEW ONLINE PATERN
    TCSSN
    MPI
    MWE
    VLSI
    DSP

  •                      Jntu btech 4th year Online Papers


    IV year previous Question Papers:

  • RRAprilMay2007-IVB.TechIISem
  • RRAugSept2007-IVB.TechIISems

     

    Please click on ebooks   and Video Tutorials  which is realated to Jntu Btech books and video tutorials.

     


     


  • Core java 2 – Volume 1 Fundamentals and Volume II Advanced Features - Sun

    Core java 2 – Volume 1 Fundamentals - Sun

    clip_image001[4]

    clip_image002[4] Download

    Core java 2 - Volume II Advanced Features - sun

    clip_image003

    clip_image002[5] Download

    Free SCJP Preparation Guide, Dump, Notes, Mock Exams and Practice Exams Download

    Saturday, April 26, 2008

    Core Java Volume I Fundamentals book

    image

    This revised edition of the classic Core Java™, Volume I–Fundamentals, is the definitive guide to Java for serious programmers who want to put Java to work on real projects.
    Fully updated for the new Java SE 6 platform, this no-nonsense tutorial and reliable reference illuminates the most important language and library features with thoroughly tested real-world examples. The example programs have been carefully crafted to be easy to understand as well as useful in practice, so you can rely on them as an outstanding starting point for your own code.

    Download

    Google
     

    blogger templates 3 columns | Techzilo