Ask Question, Ask an Expert

+61-413 786 465

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

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

  • 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

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As