Flowchart: Alternate Process: JUNE 2008

Code: AC19                                                   Subject: INTERNET & JAVA PROGRAMMING

Time: 3 Hours                                                                                                     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.       In TCP/IP, a(n) ______________ is used to identify a particular service of a server providing multiple services.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

(A)    IP address                                    (B)  Ethernet address

(C)  Protocol port number                   (D)  Subnet address

 

b.      The field of IP header that is used to prevent a datagram from travelling around and around a path having loop is

 

(A)  SERVICE TYPE                         (B)  TIME TO LIVE

(C)  FRAGMENT OFFSET               (D)  DESTINATION IP ADDRESS

            

             c.   Which of the following is a protocol to transfer data files?

                

(A)    TFTP                                           (B)  ICMP

(C)  SNMP                                         (D)  ARP

 

             d.   CGI is used to design

 

(A)     Static web documents                 (B)  Dynamic web documents

(C)  Active web documents                 (D)  Either (B) or (C)        

 

             e.   Which of the following packages is implicitly imported in all programs by Java?

                                      

(A)     java.io                                          (B)  java.util

(C)  java.lang                                       (D)  java.applet

       

             f.    How many references can point to an object at the most?

                                      

(A)     1                                                  (B)  2

(C)  3                                                  (D)  Any number of references

 

             g.   Which of the following is not a keyword related to exception handling?

  

(A)     final                                              (B)  catch

(C)  throw                                           (D)  throws

 

             h.  Which is the class at the top of hierarchy in AWT?

                 

(A)    Panel                                            (B)  Container

(C)  Window                                       (D)  Component

             i.    The isInfinite() method can be invoked by a variable/object of

       

(A)    Simple data type: double              (B)  Simple data type: char

(C)  Type wrapper class: Double         (D)  Type wrapper class: Character

 

             j.    The two foundational elements of new I/O system in Java are

            

(A)  Channels and streams                   (B)  Buffers and streams

(C)  Selectors and streams                   (D)  Buffers and channels

 

 

Answer any FIVE Questions out of EIGHT Questions.

Each question carries 16 marks.

 

 

  Q.2     a.   Briefly explain TCP/IP reference model.                                                             (8)

 

             b.   What do you understand by prefix and suffix components of an IP address? What are the two important properties of IP address hierarchy?      (8)

 

  Q.3     a.   How are domain names mapped to their equivalent IP address by the Domain Name Server? Explain.                                                                   (8)

                                              

             b.   What is the format of IPv6 base header format? Explain the functions of its various fields.                (8)

 

  Q.4     a.   Explain the working of Post Office Protocol.                                                       (8)

 

             b.   Describe the major components of a Web browser.                                            (8)          

 

  Q.5     a.   What is a Java applet? What are the two ways to execute an applet?                  (6)

 

             b.   What is the difference between constructors and methods?                                 (4)

 

             c.   What is the output of the following code segments?                                       (2 x 3)

 

                   (i)     class box{

                                    int  length, height, depth;

 

                                    box( ) { length = 100; height = 200; depth = 300; }

 

                                    public static void main(String args[]) {

                                             box  b1 = new box();

                                             box  b2 = b1;

                                             b2.length = b2.height = b2.depth;

                                             System.out.println(“b1’s dimensions ” + b1.length +

                                                                     “ ” + b1.height + “ ” + b1.depth);

                                             System.out.println(“b2’s dimensions ” + b2.length +

                                                                     “ ” + b2.height + “ ” + b2.depth);

                                    }

                           }

 


 

(ii)        class recur{

                 public static void main(String args[]){

                          int sum = meth(3, 5);

                          System.out.println("sum= " + sum);

                 }

                 static int meth(int  a, int b){

                          int result;

                          if ( a = = –b)

                                    result 0;

                          else

                                    result = a + meth(a, b – 1);

                          return result;

                 }

        }

 

  Q.6     a.   Design a class Complex having a real part (x) and an imaginary part (y). Provide methods to perform the following on complex numbers:

                   (i) Add two complex numbers.

                   (ii) Multiply two complex numbers.

                   (iii) toString() method to display complex numbers in the form: x + i y.                 (8)

 

             b.   Differentiate between the following:

                   (i) abstract classes and interfaces

                   (ii) String and StringBuffer                                                                                  (8)

 

  Q.7     a.   Design an applet that displays 15 buttons (each labeled with its index from 1 to 15) in a 4 x 4 grid layout as shown below:                                      (8)

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

 

 

             b.   What is double buffering of images? What are its advantages?                             (4)

 

             c.   Discuss the life cycle of Servlet.                                                                          (4)

 

  Q.8     a.   Describe the following terms:

                   (i) Reserved Sockets

                   (ii) Proxy Servers                                                                                               (8)

 

             b.   What is the Runtime class in Java? Write a program in Java to display the total as well as free bytes of memory available to the program at runtime.                                                       (8)  

 

  Q.9           Write short notes on                                                                                     (4 x 4)

                   (i)   ICMP

                   (ii)  Client-Server Architecture

                   (iii) Regular expression processing in Java

                   (iv) Java Swing