Directly cause thread to stop executing-thread execution

Assignment Help JAVA Programming
Reference no: EM13272824

1. What is the name of the method used to start a thread execution?

A. init(); B. start();

C. run(); D. resume();

2. Which two are valid constructors for Thread?

Thread(Runnable r, String name)

Thread()

Thread(int priority)

Thread(Runnable r, ThreadGroup g)

Thread(Runnable r, int priority)

A. 1 and 3 B. 2 and 4

C. 1 and 2 D. 2 and

3. Which three are methods of the Object class?

notify();

notifyAll();

isInterrupted();

synchronized();

interrupt();

wait(long msecs);

sleep(long msecs);

yield();

A. 1, 2, 4  B. 2, 4, 5

C. 1, 2, 6  D. 2, 3, 4

4. class X implements Runnable

{

public static void main(String args[])

{

/* Missing code? */

}

public void run() {}

}

Which of the following line of code is suitable to start a thread ?

A. Thread t = new Thread(X);

B. Thread t = new Thread(X); t.start();

C. X run = new X(); Thread t = new Thread(run); t.start();

D. Thread t = new Thread(); x.run();

View Answer Workspace Report Discuss in Forum

5. Which cannot directly cause a thread to stop executing?

A. Calling the SetPriority() method on a Thread object.

B. Calling the wait() method on an object.

C. Calling notify() method on an object.

D. Calling read() method on an InputStream object.

View Answer Workspace Report Discuss in Forum

Reference no: EM13272824

Questions Cloud

Binomal expansion to calculate the probabilities of HH : You have some trick coins that land heads 60% of the time and tails 40%. Use the binomal expansion to calculate the probabilities of HH. HT. and TT. If you flip 2 coins 175 times, what are the numbers of each?
Write a marketing plan : Identify an organization for which you would like to write a marketing plan. This can be an existing organization or a business that you would like to start.
Examples of preliminary crimes : Which of the following are examples of preliminary crimes?
Complete the scale : What is the z score for a score of 79 when the mean score of all persons who complete a depression scale is 89 and the standard deviation is 5? Is a person with a score of 79 more or less depressed than most other people who complete the scale?
Directly cause thread to stop executing-thread execution : Which cannot directly cause a thread to stop executing? What is the name of the method used to start a thread execution?
Simple java program that implements some basic file : Your code will prompt the user to enter a file name. If this file does not exist the program will produce an error message and exit. Otherwise the program will open the file and read a line from the file, reverse the line, and then print the line to ..
Differentiate between marketing in a business industry : Differentiate between marketing in a business industry of your choice to marketing within the health care industry. Be sure to discuss the key roles, the impact of the external environment, etc. within each industry.
What are different types of foriegn excahnge transicition : What are the different types of foriegn excahnge transicition?
London circus vendors : We contract with London Circus Vendors, LLC to be our food vendor at our London rollout of our circus. London Circus Vendors, LLC (LCVLLC) agrees to provide all food and beverages, and we will get a 20% commission on all sales.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java program for creating a order menu

Assume your consulting company has been hired to construct a program that meets the following requirements.

  You need to train for 10 weeks

You are preparing for a marathon. In order to prepare, you need to train for 10 weeks, running an increasing number of miles per week, starting at running at least 2 miles your first week up to 26 miles by week 10.

  Write a program that displays a drawing popular hangman game

Write a program that displays a drawing for the popular hangman game, as shown in Figure 15.32(c). draws a sketch for the hangman game.

  Identify the first character of the name and lengthof length

Write a Java application that stores the names of your family and friends in a one-dimensional array of Strings. The program should show all names in upper case and lower case, identify the first character of the name, and the lengths of the names.

  How many numbers do you want to enter

Write a program that asks the user "How many numbers do you want to enter?" With that value, create an array that is big enough to hold that amount of numbers (integers).

  Displays the number of days in a month

Create a program that displays the number of days in a month. Use a 12-element one-dimensional array to store the number of days in each month (use 28 for the number of days in February).

  Class pointparameters

What is the output of the following Java program? Explain in terms of how parameters are passed in Java.import java.awt.*;class PointParameters

  Considered to be an improved version

Part (c) is considered to be an improved version of Part (b). You may use an array (2-dimessional) to store some values that has been computed during the run so that when making recursive calls the program does not compute certain values over and ..

  Calculate the optimal position of the large pipeline

Your task is to calculate the optimal position (on the y-axis) of the large pipeline, so that the total length of all smaller pipelines is shortest

  That uses a library database of books

Write a Java program that uses a library database of books and patron data, as described in Exercise R22.2. Patrons should be able to check out and return books

  Java program to write-read data from user using i-o function

Write java program to write and read data from user using I/O functions. Describe class with data members name[20],emp_id,basic pay,net pay.calculate all the allowances.

  Follow the projects suggestion

Be sure that you follow the projects suggestion and create a separate class for the word analysis. An instance of this class and its methods should then be called by your GUI interface.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd