Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java-Assignment #4 (Due, April. 9, 2004)

Similar presentations


Presentation on theme: "Java-Assignment #4 (Due, April. 9, 2004)"— Presentation transcript:

1 Java-Assignment #4 (Due, April. 9, 2004) 1.(20) Write a program to implement an interface with a lamp and five buttons labeled with ‘red’, ‘green’, ‘blue’, ‘black’ and ‘grey’, respectively. When a button is clicked, the lamp will be changed to the color specified by the botton lable. (Using Java 1.1 event model.) 2.(30) Given a bit string (32 bits). Write a java program to check whether it contains only two consecutive 1s and all the other bits are 0s. (E.g., is such a string.)

2 Java-Assignment #4 3. (a) Answer the following questions:
(Due, April. 9, 2004) 3. (a) Answer the following questions: What is a thread? Name two ways to create a thread. What is the meaning of “synchronized”? (5) (b) Implement the program (with class name “DeadlocDemo”) shown in the lecture notes. (10) (c) Analyze the output of the program. (5)

3 Java-Assignment #4 (Due, April. 9, 2004) 4. (a) Implement a program to input the following into a file: true, ‘A’, , 23, -9.3, 21, -23, 90, 7.6 (8) (b) Implement a program to read data from the file created by 2(a) (8) 5.(14) Implement a program to input a table containing the visible Ascii characters into a file and then read it from the file (and display it on the screen).


Download ppt "Java-Assignment #4 (Due, April. 9, 2004)"

Similar presentations


Ads by Google