Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Java Expert


Home >> Java

problem 1: Create three classes: storage, printer and counter. The storage class must store an integer. The counter class must make a thread which begins counting from zero and stores each value in the storage class. The printer class must create a thread which keeps reading the value in the storage class and printing it.

problem 2: Create a program which makes an instance of the storage class and sets up a counter and a printer object to operate on it. The program is needed to print only 10 values.

problem 3: Fill up the blanks:

a)  ......... permits a running program to perform some tasks, apparently, at similar time.

b) .................. between threads is taken out automatically by JVM.

c) When we make a thread object, it is stated to be in the .................. state.

d) A thread is stated to be in .................. state when it is suspended, sleeping or waiting in order to satisfy certain condition.

e) .................. is the manner to avoid data corruption caused by simultaneous access to the similar data.

f) The threads communicate through .................. for each other.

g) .................. threads get more CPV time than .................. threads.

h) The .................. technique of the thread class is deprecated in the Java 2.

problem 4: Which of the given statement is correct for the line illustrated below?

Thread myT = new Thread( );

a) The myT is in runnable state.
b) The thread myT has the NORM_PRIORITY.
c) If myT.start( ) is called, the run method in the calling class will be executed.
d) If myT.start( ) is called, the run method in the thread class will be executed.

problem 5: The object class consists of a wait method which is used to coordinate access to an object by multiple threads. Which of the given statements regarding the wait method are true?

a) The wait method is an instance method of object class.
b) The wait( ) method is a static method of object class.
c) To call wait, a thread should have a lock on the object included.
d. An object can have just one thread in the waiting state at a time.

Java, Programming

  • Category:- Java
  • Reference No.:- M98727

Have any Question? 


Related Questions in Java

Student class and driverthis student class will be the data

"Student Class and Driver" This Student Class will be the data that will be used for each of the projects assigned and graded this semester. Your Student Class will consist of: Student Attributes: First Name Last Name ID ...

Java- object-oriented and concurrent programmingheres a

Java- Object-Oriented and Concurrent Programming Here's a very quick overview of the projects: 1. Read a data file, create the internal data structure, create a GUI to display the structure, and let the user search the s ...

Develop an application in java to accept the number of

Develop an application in Java to accept the number of students in a section for a subject and for each student accept the student number, Student name, prelim marks, midterm marks, final marks. The final grade should be ...

Overviewthis assignment is intended to familiarize students

Overview: This assignment is intended to familiarize students with web application design, basic servlet functionality, and application deployment with a focus on servlet HTML generation and page navigation. The goal is ...

Programmers often develop different types of accounts to

Programmers often develop different types of accounts to provide access to a program for a variety of users. The structure of each account is formatted based on the needs of the user and how the program will be used. One ...

Part 1 text readingchapter 3 chapter 4 part 2 textbook

Part 1. Text reading Chapter 3, Chapter 4 Part 2 . Textbook questions Chapter 3. Describe why an application developer might choose to run over TCP rather than UDP. Suppose host A is sending host B a large file over a TC ...

Pogramming assignmentmickeymouse- x int- y int- size

Programming Assignment MickeyMouse - x : int - y : int - size : int -color: Color + MickeyMouse(): + setLocation (x: int, y: int): void + setSize (size: int): void + setColor(color: Color):void + draw(canvas: Graphics2D) ...

Twitter is a popular social media platform for users to

Twitter is a popular social media platform for users to send out a short message (a "tweet") to other users who are registered as his/her followers. Figure 1 shows a graph. (The topic on graphs will be covered after your ...

Instructionsi what are the diagrams defined in the uml

Instructions I. What are the diagrams defined in the UML Standard. Give a one or two sentence description of each one. II. Given the following code, how should the toString methods in the classes H2ClassA and H2ClassB be ...

The class below has some errors for each error do the

The class below has some errors. For each error do the following: a) Write the erring section of code and explain what the error is. b) Fix the error (i.e. re-write the code correctly). public class ClassWithErrors { pub ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate