Question: ASAP, PLEASE HELP ME Multithreading is supported by the: Thread interface Runnable class and the Thread interface Thread class and the Runnable interface Runnable class

ASAP, PLEASE HELP ME

Multithreading is supported by the:

Thread interface

Runnable class and the Thread interface

Thread class and the Runnable interface

Runnable class

When creating a runnable object, why might you want to extend Thread rather than implement Runnable?

When you want to override one or more of Threads methods other than run().

When you want to overload one or more of Threads methods such as run()

Both a and b are correct

When you want to instantiate the runnable object.

Show how to use join() to wait for a thread object called MyThrd to end

Thread MyThrd.join();

Object MyThrd = MyThrd.join();

join().MyThrd;

MyThrd.join();

Show how to set a thread called MyThrd to three levels above normal priority MyThrd.setPriority(Thread.NORM_PRIORITY , 3);

MyThrd.setPriority(Thread.NORM_PRIORITY + 3);

MyThrd.setPriority(Above.NORM_PRIORITY, 3);

MyThrd.setPriority(Above.NORM_PRIORITY + 3);

Adding synchronized to a method allows only one thread at a time to use the method for any given object of its class.

True or false ?

The wait() and notify() methods are used to perform

synchronized communication

outerthread communication

innerthread communication

interthread communication

What method defined by Thread obtains the name of a thread?

SetName(0

readName()

loadName()

getName()

What does isAlive() return?

true if the invoking thread is still running

true if the invoking thread has been initialized

false if the invoking thread has been terminated

either A or C

Why cant you use suspend(), resume(), and stop() for new programs?

The three methods have been deprecated because they can cause serious logic problems

You can you use suspend(), resume(), and stop() for new programs with no problems

The three methods have been deprecated because they can cause serious run-time problems.

The three methods have been deprecated because they can cause serious compile-time problems

Exception UnknownHostException occurs when:

a hostname indicated by a client cannot be resolved to an address.

a client name indicated by a host cannot be resolved to an address.

a hostname not indicated by a client cannot be resolved to an address.

a client name not indicated by a host can be resolved to an address.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!