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

The paris hotels company needs a computer program to track

The Paris Hotels Company needs a computer program to track their hotel occupancy for the hotels in their chain. Write a Java program that calculates the occupancy rate for each floor of a hotel. A hotel's occupancy rate ...

Assignmentthis assignment consists of two sectionsbulljava

Assignment This assignment consists of two sections: • Java program file(s) • A screenshot of the execution and source code of your Java program Label each file name according to the section of the assignment for which i ...

Assignmentexercise1write a java class that asks the user to

Assignment Exercise#1: Write a java class that asks the user to enter three numbers N1, N2, N3 , obtains the numbers, then calculates and displays the largest number Max followed by the text "is the largest" and the smal ...

Module assignment introduction to programming using

Module Assignment: Introduction to Programming Using Java This assignment is to provide practice using arrays and strings along with other Java programming techniques discussed so far in the course. For this assignment, ...

Java programming assignmenttask 1write a program that

JAVA PROGRAMMING ASSIGNMENT TASK 1 Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer. Remember the rules around proper development style and form, inclu ...

Write a java application using netbeans integrated

Write a Java application using NetBeans Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: A salesperson will earn a fixed salary of . ...

1how does java support the concept of encapsulation2

1. How does Java support the concept of encapsulation? 2. Describe the difference between an object and a class. 3. What is the difference between the contents of a Java variable of a primitive type and a Java variable o ...

Develop a console program for java on microsoft notepad

Develop a console program for JAVA on Microsoft notepad that simulates a section of a restaurant menu. Each item will have a different price and your program should define at least ten items. You will need to obtain an o ...

Create a separate class for the selected product that holds

Create a separate class for the selected product that holds the item number, the name of the product, the department in which the product belongs, the number of units in stock, and the price of each unit. You must use th ...

Java programmingscenario a mom and pop used car dealership

JAVA PROGRAMMING SCENARIO: A Mom and Pop used car dealership wants you to create a program that will manage their sales and inventory. They have provided a menu for you to follow. 1. Add To Inventory 2. Remove From Inven ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen