Ask Question, Ask an Expert


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

Programming assignment - summer semester 2015-purpose-to

Programming Assignment - Summer Semester 2015- Purpose- To provide students with the opportunity to apply the knowledge acquired and skills developed. These include understanding of primitive data types and the concept o ...

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 ...

Chapter 1 - challenge 3 - training workshopsyour company

Chapter 1 - Challenge #3 - Training Workshops Your company likes to present training workshops that help people in the information technology industry improve their skills. Your task is to write and object-oriented appli ...

Java question1write an application that prompts a user for

JAVA Question 1. Write an application that prompts a user for a month, day, and year. Display a message that specifies whether the entered date is not this year, in an earlier month this year, in a later month this year, ...

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) ...

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 ...

1 problem overviewyou have been asked to design and

1 Problem Overview You have been asked to design and implement a training system for company directors. In the best tradition of economics, we shall start by making things up. The training system is intended to show peop ...

Question 1 illustrate that the nodes of any avl tree t can

Question 1. Illustrate that the nodes of any AVL tree T can be colored "red" and "black" so that T becomes a red-black tree. Question 2. Illustrate that via AVL single rotation, any binary search tree T1 can be transform ...

This assignment is based on the principles of clock

This assignment is based on the principles of clock consistency and associated drifts in a distributed system. You have to create a simulation, running on a single machine, of a simple distributed system involving four p ...

Code reviewcan some have this done immediatelypublic class

Code Review Can some have this done immediately public class BankAccount { private double balance; public BankAccount() { balance = 0; } public BankAccount(double initialBalance) { balance = initialBalance; } public void ...

  • 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