Ppl home assignment_unit4

343 views
258 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
343
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ppl home assignment_unit4

  1. 1. Bansilal Ramnath Agarwal Charitable Trust’s Vishwakarma Institute of Technology, Pune-37 Principles of Programming Languages CS 20105 – SE – E Home Assignment 4Assignment Date: 18th April 2012 Submission Date: 23rd April 2012Answer all 9 questions:1. Explain the connection between ‘package’, ‘import’ and ‘classpath’ in Java.2. Write a Java program to print 1,2,3,4… till 100 and A,B,C… till Z, both inparallel.3. How to create a thread in Java using Runnable interface?4. If a thread is in “blocked” state, what does it mean?5. What is a deadlock? Explain with an example.6. What is “synchronized” keyword in Java? When is it used? Where is it used?Explain.7. Write a Java program to read a file called “abc.txt” and print its contents onthe screen using FileInputStream class.8. Write a Java program to read a file called “abc.txt” and print its contents onthe screen using FileReader class.9. Write a Java program to keep reading lines of user input from the consoleuntil the user inputs “-1”. Page 1 of 1

×