AMIETE – CS (OLD SCHEME)

 

Code: AC19                                                   Subject: INTERNET & JAVA PROGRAMMING

Flowchart: Alternate Process: JUNE 2009Time: 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 the best alternative in the following:                                  (210)

 

             a.  What is ARP used for?

 

                  (A) To map hardware address of a machine to its IP address

                  (B) To map IP address of  a machine to its hardware address

                  (C) To map website address to its IP address

                  (D) To map website address to its hardware address.

 

             b.  If all three top-level elements occur in a source file they must appear in which order?

 

                  (A) Import statements, package declaration, classes                                                          

                  (B) Package declaration, import statements, classes

                  (C) Imports must come first; order for package declaration and class definitions is not significant     

                  (D) Package declaration must come first; order for import statement and class definitions is not significant

 

             c.  Given these declarations, choose the correct answer?

                        byte x = 5;

byte y = 2;

byte z = x * y;

                  System.out.println("Value of z is " + z);

 

                  (A) Value of z is 10                              (B) Value of z is 5

                  (C) Value of z is 2                                (D) Compiler Error

          

             d.  latest version of IP is known as

 

                  (A) IPv2.                                              (B) IPv4.

                  (C) IPv6.                                              (D) IPv8.

 

             e.  Which of the following can be used to create active web documents?

 

                  (A) CG1                                              (B) ASP

                  (C) Cold Fusion                                   (D) Java Script

 

             f.   Exceptions defined by Error and RuntimeException classes and their subclasses are known as

 

                  (A) Runtime error.                                (B) Checked exception.

                  (C) Unchecked exception.                    (D) Both (B) and (C).

 

             g. Which of these events will cause a thread to die?

 

                                                                              (A) The method sleep() is called.                          

                  (B) The method wait() is called.

                  (C) Execution of the start() method ends.                                                                         

                  (D) Execution of the run() method ends.

 

             h.  The ______ layout manager is the default layout manager for frame.

 

                  (A) Flow layout manager                      (B) Card layout manager

                  (C) Border layout manager                   (D) Grid bag layout manager

 

             i.   _________can be used to provide telephone services over the internet

 

                                                                              (A) MIME                                            (B) SMTP

                  (C) VoIP                                              (D) ICMP

 

             j.   A "mode" argument such as "r" or rw" is required in the constructor for the class

 

                  (A)  DataInputStream                           (B) InputStream

                 (C)  RandomAccessFile                        (D) File

 

 

 

Answer any FIVE Questions out of EIGHT Questions.

Each question carries 16 marks.

 

 

  Q.2     a.   Define UDP and discuss the different fields of the format of a used datagram? Also, list some of the uses of the UDP protocol.       (5+3)

 

             b.   Discuss client-server paradigm. What are the characteristics of clients and servers in client-server paradigm?                       (2+3+3)                                                                                                                  (8)

 

  Q.3     a.   How does fragmentation and reassembly of datagrams take place in IPv4?  (6)

 

             b.   Differentiate between Connectionless and Connection-Oriented services.            (4)

       

             c.   Discuss the different types of web documents.                                                    (6)

       

  Q.4          Write short notes on the following:                                                         (44 = 16)

 

(i)               ICMP (Internet Control Message Protocol)

(ii)              IP telephony

(iii)            Domain Name system          

(iv)            HTTP

 

  Q.5     a.   The signature for main() function in every Java application program is

                   public static void main(String args[])

                   What is the role of keyword ‘static’ in the above declaration? What happens if we don’t write keyword static in the above declaration?            (4)

 

             b.   Design a class to represent “account” information of an individual that includes the following members:-


 

                        Data Members

·        Name of account holder -------- String

·        Account number ---------- int

·        Type of Account --------- Boolean

·        Balance Amount ---------- double

Member Functions

·        To assign initial values (using constructor)

·        To display the name of account holder and balance amount in the account.

·        To deposit an amount in the account.

·        To withdraw amount after checking balance and minimum balance is Rs. 100.         

Use the above class to write an interactive program.                                       (8)

 

             c.   Under what circumstances the compiler insists that a class must be declared as an abstract class? Can an abstract class be declared as final also? Justify your answer.                                                           (4)                               (4)                   

 

  Q.6     a.  Java has two ways to create child threads. What are these two methods? Explain them. Which of the two do you think is better and why?     (2+4+2)

 

             b.   What are packages? How Packages are declared and defined in Java programming language? Write the advantages of using packages in Java programs.                                                                                                    (2+4+2)

 

  Q.7     a.   Write a programme to copy a file using the new I/O system of Java.                    (5)

 

             b.   Write a function in Java that displays the protocol, port number and host server for a website address passed to it as an argument.     (5)                                                                                                              (7)       

       

             c.   Create a try block that is likely to generate exception at three different places.  Provide the necessary catch blocks to catch and handle those exceptions.                                                                                                         (6)

 

  Q.8     a.   Write a program in Java that reads a string and rewrite it in the alphabetical order. For example, the word STRING should be written as GINRST.                                                            (8)

 

             b.   Write an applet that shows the names of all the available font families in the system.                                                (8)

         

  Q.9     a.   What is Java Beans? Give its advantages. What are the various steps which are needed to create a new Bean?             (2+3+3)

 

             b.   What is Event Delegation Model? Explain the terms Event, Event Source and Event Listener in this respect.                       (2+2+2+2)