Q.1. (a) What is an object oriented paradigm ? Explain two differences between the object oriented paradigm of programming languages and the structured paradigm of programming languages.
(b) What is message passing ? Explain the need of message passing in object oriented programming with an example.
(c) What is a constructor ? Write a Java program to explain the need of a constructor in problem solving.
(d) Write a program in Java which reads two real numbers, finds the sum of these two numbers and prints the real and imaginary part of this sum separately.
(e) What is 'super' ln Java ? Explain at least two different uses of 'super' in the Java programs, with an example.
(f) Write a program in Java to find whether the size of a given file is less than 50 bytes or not; and if it is less add characters to make it 50 bytes.
(g) Explain two situations when String Buffer would be used for string handling. Also write a program which appends the string "programming", to the string "Java". Print the final content of the appended string.
(h) What is an event ? Explain different components of an event.
Q.2. (a) What is a Servlet ? Explain the use of GET and POST methods.
(b) What is method overloading ? What are the important points which should be taken care of while overloading methods ? Write a Java program to explain the working of overloaded methods.
(c) What is Border Layout ? Write a Java program which creates Border Layout and adds two text boxes to it.
Q.3. (a) Explain the following concepts with an example of each :
(i) Class and Object;
(ii) Inheritance.
(b) Find the errors in the foliowing Java program, and correct them.
Class Examination;
{
public void main (args[])
{
system.out.println ("Java is an OOL)
int i = 10;
for (i > 0; i - -)
system.out.println ("i="i);
}
}
}
(c) Write a program in Java which finds the number of lines and number
of characters in a given file.
(d) What are the advantages of 'platform independent languages' ? Also explain how Java is platform independent.
Q.4. (a) What is a session ? How does URL rewriting store session details ? Explain this with an example.
(b) What is an exception ? Explain, with an example, how exceptions are handled in Java.
(c) What is multithreading? Explain two advantages of multithreaded programs. Write a program in Java to explain how different priorities can be assigned to different threads.