Anda di halaman 1dari 3

Roll No. .................

Total No. of Questions : 13] [Total No. of Pages : 03

Paper ID [A0522]
(Please fill this Paper ID in OMR Sheet)

MCA (502) (S05) (Sem. - 5th) JAVA PROGRAMMING


Time : 03 Hours Maximum Marks : 75

Instruction to Candidates: 1) 2) Section - A is Compulsory. Attempt any Nine questions from Section - B. Section - A (15 x 2 = 30) Q1) a) b) c) d) e) f) g) h) What is a thread? What are the two ways to create the thread? How does one compute the class of an IP address? What range determines the class A IP address? With reference to Java graphics, explain the terms: a component and a container. What is the purpose of a layout manager in Java? What is the purpose of the class java.lang.Thread? What does it mean to declare a member variable to be static final? Give one reason why you might want to do this. What does it mean to say that classes can be arranged in a class hierarchy, and why might it be useful to do this? A variable in Java can never hold an object, only a reference to an object. Explain what this means.

J-8124[S-9700413]

P.T.O.

i)

Show the exact output produced by the following code segment: int a, b, c; a = 18; b = 1; c = 1; while (a > 0) { b = b + c; a = a / b; c++; System.out.println(a + , + b + , + c); }

j) k)

What is a package in Java, and how are packages used? Give an example of one of the standard packages that are part of Java. Explain carefully what is accomplished by this statement: double[ ] values = new double[5];

l)

What are the essential characteristics of an array, as it is used in Java?

m) When you compile a Java source code file (such as Measures.java) with the javac command, you get a class file (such as Measures.class). What sort of information is contained in the class file? n) Which choice statement is false? (i) The final modifier is used to declare a data member that can not be modified once it is initialized. (ii) The static modifier is used to declare a data member whose value is shared by all instances of the class. (iii) The protected modifier is used to declare a data member that can be read by instances of a super class. (iv) The public modifier is used to declare a data member that can be accessed by an unrelated class. (v) The private modifier is used to declare a data member that can not be accessed by subclasses. o) What is the difference between TCP & UDP?

J-8124[S-9700413]

Section - B (9 x 5 = 45) Q2) What are operators and what are the various types of operators available in Java? Q3) Explain the applet life-cycle. In particular explain the roles of the init, start, stop, paint and destroy methods? Q4) Explain Listeners and Events with reference to Java SWING components. Give two example events, stating how they are generated, and two example listeners, explaining what they are listening for. The example listeners need not manipulate the example events. Q5) Write a complete class definition for a class named player that meets the following specifications: An object of type Player represents a player in a game. The object has private instance variables to represent the players name and score. There is one constructor, with a parameter that specifies the players name. (The players score is initially zero.) The class defines methods for getting the players name and score and for adding a specified number of points to the score. Q6) It is known that The socket API is available for many operating systems, including systems used on personal computers (e.g. Microsofts Windows systems) as well as various UNIX systems (e.g. Sun Microsystems Solaris). Explain what a socket is and why socket libraries are necessary when writing software applications for differing operating systems. Q7) What is JDBC? How do you connect to the Database? Q8) What is multithreading? What is synchronization with respect to multithreading and why is it important? Q9) What is the difference between the File and RandomAccessFile classes? Explain by taking examples. Q10)What is a constructor? How are this( ) and super ( ) used with constructors? Explain by taking examples. Q11)What is meant by Java Servelets? What is the difference between the HTTPServlets and Generic Servlets? Explain their methods and the parameters of those methods? Q12)What is the need of exception handling? Explain the use of try-catch block in exception handling with the help of a program. Q13)What is a String class? Explain any three constructors of String class. J-8124[S-9700413]
3

Anda mungkin juga menyukai