lecture-37 - Thread Methods sleep method causes the thread...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 19 Thread Thread Methods Methods sleep() method causes the thread from which it is called to suspend execution for the specified period of milliseconds static void sleep(long milliseconds) throws InterruptedException static void sleep(long milliseconds, int nanoseconds) throws InterruptedException
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 20 Thread Thread Methods Methods Obtaining the name of the thread: final String getName() Setting the name of the thread: final void setName(String threadName)
Background image of page 2
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 21 Two Ways to Create Two Ways to Create Threads Threads 1. You can implement the Runnable interface 2. You can extend the Thread class
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 22 Implementing Implementing Runnable Runnable • To implement Runnable , a class needs to implement only a single method:
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 19

lecture-37 - Thread Methods sleep method causes the thread...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online