Thursday , 21 November 2024

CS508 Assignment no 04 Spring 2013

 

Assignment No. 03
Semester: Spring 2013
Modern Programming Languages  (CS508)

 Total Marks: 15

 

Due Date:  08/07/2013

 Instructions:

Please read the following instructions carefully before submitting assignment:

 

  • You will submit your assignment before or on due date on VU-LMS.
  • Assignment should be completed by your own efforts it should not be copied from internet, handouts or books.
  • You should submit your MS Word File via assignment interface at VU-LMS.
  • Assignment sent via Email will not be replied and accepted/graded in any case.
  • If the submitted assignment does not open or file is corrupt, it will not be graded.
  • You will submit solution only in word file.

 


Objectives:

 

To understand and familiarize with JAVA Language.

 

 

For any query about the assignment, contact at cs508@vu.edu.pk or through MDB.

Assignment Questions

 Question # 1                                                                                                                               Marks 5     

 

How can we avoid Aliasing Problems in Java, provide a code example. Keep your answer to the point.

 

Question # 2                                                                                                                              Marks 10     

 


You will write a simple Java code that will demonstrate working of threads. You will write two classes, one CS508.java and 2nd one will be SimpleThread.java.

 

SimpleThead.java will extend the thread class. In run method, your thread will display its name and number of milliseconds (0 to 5000) it will sleep for. And then it will sleep randomly for 1 to 5000 milliseconds. Once thread has finished it will display its name and message that it has finished. One thread will sleep 5 times before ending.

 

In CS508.java, you will create 3 threads of SimpleThread  and will run them. Name of the first thread will be your name, name of second thread will be your VU student id, and name of 3rd thread will be VU.

 

Here is the sample output of the code that you will write

Cs508 assignment no 4 solution spring 2013

Note:

1) No need to send the java/class files, put code in word file along with answer of the first question.

2) For question number one you can search over the internet. But do not copy paste the contents as it is , use your own words.

 

BEST OF LUCK

 

 

Check Also

CS508 Assignment no 03 fall 2013 idea Solution

  Assignment No. 03 Semester: Fall 2013 Modern Programming Languages  (CS508)  Total Marks: 15   …

Leave a Reply

Your email address will not be published. Required fields are marked *

*