You are on page 1of 2

Reg. No.


B.E./B.Tech. DEGREE EXAMINATION, APRIL/MAY 2011 Fifth Semester Information Technology

IT 2301 — JAVA PROGRAMMING (Regulation 2008) Time : Three hours Answer ALL questions PART A — (10 × 2 = 20 marks) 1.

Give the properties of abstract classes and methods and write a suitable example. Why does Java not support destructors and how does the finalize method help in garbage collection? Write a declaration to convert the value ‘‘Programmer’’ in the string variable ‘convert’ to ‘‘programming’’. Distinguish between static and dynamic binding. How does the declaration of a local inner class differ from the declaration of an anonymous inner class? Write a code to copy the contents of the file input.txt one byte at a time to output.txt using FileInputstream and FileOutputStream. When do the following events occur? (a) AdjustmentEvent (b) ItemEvent



4. 5.

30 4




Write down the statements used to create a JFrame and a JButton and then add the JButton to the JFrame.


List any two advantages of type parameters.



Maximum : 100 marks


Question Paper Code : 11383

(a) (b) 15. (8) Write a java program to search for a number in the given array using binary search. What is reflection and how does it help to manipulate java code? (b) Consider a class person with attributes firstname and lastname. (a) (i) Write a program to find whether a number is a palindrome or not. (i) (ii) Write a Java program to perform matrix multiplication using arrays. Write a program to create a calculator using swings with the four basic arithmetic operations : +. Write a java program to create and clone instances of the Person class. (8) (ii) Discuss the working and meaning of the ‘‘static’’ modifier with suitable examples. *. 30 Or 2 ————————— 4 Or 30 4 11383 . (8) Or (b) Explain in detail as to how inheritance and polymorphism are supported in Java with necessary examples. –. With suitable examples consider the number of restrictions to consider when working with java generics. /. (8) 12. (a) (b) 13. When would you use the CountDownLatch synchronizers and Exchange Synchronizers? PART B — (5 × 16 = 80 marks) 11. (a) Give a detailed explanation of packages in Java. (a) Draw the exception hierarchy in java and explain with examples throwing and catching exceptions and the common exceptions. Or 30 4 (b) Write short notes on what threads are and the thread states and properties.10. Or 14.