Introduction to Internet Programming.pdf - Google Drive

0 downloads 60 Views 56KB Size Report
(c) What is object serialization ? Write a. program fragment to show ... Page 3 of 4. Main menu. Displaying Introduction
I CS-74 I BACHELOR IN COMPUTER APPLICATIONS Term- End Examination

December, 2009

00

CS- 74 : INTRODUCTION TO INTERNET PROGRAMMING Maximum Marks : 75

Time : 3 hours

Note : Question No. 1 is compulsory. Attempt any three from the rest.

1.

(a) What is abstraction ? Explain through an example.

3

Differentiate between call-by-value and 3+3 call-by-reference with the help of suitable example. When are the members of a class declared 3+3 static ? What are the restrictions on a static method ? Discuss in brief two methods used for applet 2+2 execution. Write a recursive function in Java to print the gcd of two given integer numers. CS-74



1

5

P.T.O.

(f) Write the out put of the following :

1+3=4

int n = OX FFFFFFE for (int i = 0 ; i < 3 ; i ++) {

n = n > 2;

2.

3.

(a)

Differentiate between throw and throes with the help of suitable example.

4

(b)

What is dynamic method dispathc ? Explain.

5

(c)

What is object serialization ? Write a program fragment to show how an object can be saved to and retrieved from file storage.

6

(a)

Can you extend an Interface in Java ? Explain with the help of a program fragment.

5

(b)

Write a program to show the use is Alive () and join () in Java.

6

(c)

Write a program to show the use of multiple catch statements with single try block ?

4

CS-74

2



4.

5.

(a) Write a program to copy one file to another file. Name of files are given at command line. What is an Inner class ? Explain with an example. Why do we use packages in Java ? How packages are created in Java ? Explain. List 5 important packages of Java. (a) What are the error (S) in the following code ? Also correct the error(s).

6

4 5

4

Class Demo I Public static void main ( string args [ I ) int x ; x = 10 ; if (x = = 10) f int y= 20; x=y*2 System. out. print In ("x =" +

System. out. print In ("y =" + y) ; } }

CS-74

3

P.T.O.

(b) Is it possible to overload constructors ?

4

Why would it be done ? Give suitable examples. If we have to prevent a class from being inherited, how can, we do it ? Explain.

2

Write the output of the following code :

5

String S = " This is my first Java Program" ; System. out. println ("index of (S) =" + S.index of ('S')) ; System. out. println ("index of (S) =" + S.index of ('S', 6)) ; -o0o-

CS-74

4