Code: C–19                                                   Subject: INTERNET & JAVA PROGRAMMING

Time: 3 Hours                                                          Flowchart: Alternate Process: December 2005                                           Max. Marks: 100

 

NOTE: There are 9 Questions in all.

·      Question 1 is compulsory and carries 20 marks. Answer to Q. 1. must be written in the space provided for it in the answer book supplied and nowhere else.

·      Out of the remaining EIGHT Questions answer any FIVE Questions. Each question carries 16 marks.

·      Any required data not explicitly given, may be suitably assumed and stated.

 

 

Q.1       Choose the correct or best alternative in the following:                                         (2x10)

       

a.       Which of the following command provides the list of the computers that lie on the path of a packet from the source to the destination?

 

                   (A)  telnet                                            (B)  ftp

(C)    traceroute                                    (D)  ping

       

b.      In TCP/IP suite, which of the following is true?

 

(A)    TCP provides a connection oriented and reliable service over connectionless and unreliable IP.           

(B)    TCP provides a connection oriented and reliable service over connectionless and reliable IP.

(C)    TCP provides a connection oriented and reliable service over connection oriented and unreliable IP.   

(D)    TCP provides a connection oriented and reliable service over connection oriented and reliable IP.

            

             c.   The IP address 192.10.2.3 belongs to

                  

(A)    class A.                                        (B)  class B.

(C)  class C.                                        (D)  class D.

 

             d.   The protocol used by the recipient to retrieve the email from the mailbox is

 

(A)    SMTP.                                       (B) FTP.

(C)  HTTP.                                         (D) POP.  

 

             e.   In which of the following code fragments, the variable x is evaluated to -4?

                  

(A)     int x = -8;                                     (B)  int x = -8;

       x  >>> = 1;                                         x >> = 1;

(C)  int x = -8;                                     (D)  int x = -8;

                           x  >>> = 2;                                         x  >> = 2; 


 

             f.    Consider the following class definitions:

                           class A  {B    b; }

                            class B  {int    i;}

                   This code represents                           

 

(A)     An “is a” relationship.                   (B)  A “has a” relationship.

(C)  Both (A) and (B).                         (D)  None of the above.

 

             g.   Consider the following try..catch block:

                               class TryCatch{

                                             public static void main(String args[]) {

                                                                    try {

                                                                             double         x = 0.0;

                                                                        throw(new Exception(“thrown”);

                                                                                 return;

                                                               }

                                                   catch (Exception e) {

                                                               System.out.print(“exception caught”);

                                                               return;

                                                   }

                                       finally {

                                                   System.out.print(“finally”);

                                       }

                   }

 

(A)     thrown exception caught finally.   

(B)     finally thrown exception caught.

(C)     exception caught.

(D)    exception caught finally.               

 

             h.   When we implement the Runnable interface, we must define the method

 

(A)    run().                                            (B) init().

(C) start().                                           (D) main().

 

             i.    To assign a value “C – 19 Internet and Java Programming” to the variable exam, which of the following lines can be used in an <applet> tag?

 

(A)   exam = getParameter(“C – 19 Internet and Java Programming”)         

(B)   <param exam = “C – 19 Internet and Java Programming”>

(C) <exam = “C – 19 Internet and Java Programming”>   

(D) <param name = exam value = “C – 19 Internet and Java Programming”>

 

             j.    In OSI reference model transmission of raw bits occurs in

 

(A)  session layer.                                (B)  application layer.

(C)  network layer.                              (D) physical layer.

 

 

 

 

Answer any FIVE Questions out of EIGHT Questions.

Each question carries 16 marks.

 

  Q.2     a.   Describe the following entries of an IP datagram header:

                   (i)    Header Checksum (ii)  Service Type (iii) Total length                          (3x2=6)

       

             b.   What is a DNS? What is it used for? What is the significance of type ‘A’, ‘Mail eXchanger’ or ‘CNAME’ in its entries?                                           (6)

 

             c.   How is the reassembly of IP datagram fragments done by destination machine?                   (4)

 

  Q.3     a.   Under what circumstances a router generates the following ICMP messages?                   

                   (i)   Source Quench                             (ii)  Redirect

                   (iii)  Destination Unreachable                                                                              (6)

 

             b.   Describe the three advantages of having multiple extension headers in IPv6 over fixed sized headers of IPv4?                                                                                                                         (6)          

 

             c.   What is the advantage of having separate connections for control and transfer between the FTP client and FTP server?                                        (4)                                                             

 

  Q.4     a.   Design an applet “Largest” that receives three numeric values as input from the user and then displays the largest of the three on the screen.         (9)

 

             b.   What do you understand by buffers and channels in the new I/O system of Java?                (7)

 

  Q.5     a.   Write the HTML code that displays “Largest of Three Numbers” in the title bar and executes the “Largest” applet of Q.4 a.                                   (5)

       

             b.   How does caching in web browsers improve the performance in web browsing? What are the disadvantages of retaining the items in a cache for an extended time period?                                              (5)

 

             c.   Describe the three-way handshake method to terminate a connection in TCP.                     (6)       

 

  Q.6     a.   Explain the concept of CGI scripting.   (5)

 

             b.   In AWT, what do the following terms mean and how are they related to each other?          

                   (i)   Component                                   (ii)  Container

                   (iii)  Panel                                            (iv)  Window                                          (8)

 

             c.   Briefly explain what functions do the socket APIs bind() and listen() perform?                     (3)

 

  Q.7     a.   Write a program in Java to read a square matrix, a. The program should display “Symmetric” if a[i][j] =  a[j][i] for i, j = 1, 2, …, n; where n is also entered by the user. It should display “Asymmetric” otherwise.                                                           (8)   

 

             b.   What are the static methods? The non-static methods can call static methods but not vice-versa. Why?                                                                  (5)

 

             c.   What are the three uses of the ‘final’ keyword?                                                 (3)

 

  Q.8     a.   Write a program in Java to add two complex numbers. Overload toString() method to display the result as a complex number.                                 (8)

 

             b.   Differentiate between the following:

(i)                  equals() and == for strings

(ii)                interface and classes                                                                   (4)

                                              

             c.   Describe the Delegation Event Model of Java.                                                    (4)

       

  Q.9           Write short notes on the following:

                  

(i)                  Wrapper classes

(ii)                Java Swing

(iii)               Java thread model

(iv)              Remote Method Invocation                                                      (16)