Principles of Programming Languages-Engineering-Pune University-Nov2018
S.E. (Computer Engg.) (Second Semester) EXAMINATION, 2018
PRINCIPLES OF PROGRAMMING LANGUAGES
Time: Two Hours Maximum Marks : 50
N.B.:— (i) All questions are compulsory.
(ii) Figures to the right indicate full marks.
1. (a) Explain the use of paint( ), update( ) and repaint( ) methods for applet programming. What is the difference in paint( ) and repaint( ) methods ? 
(b) What are predefined I/O classes? Show with example how BufferedReader class is used in Java to receive character and string inputs. 
2. (a) What is Character Streams and Byte Streams ? State any two examples of each predefined Character and Byte Stream classes for I/O in Java. 
(b) What is an exception in Java? What do you mean by handling an exception? Give example to show the use of try( ),Catch( ) methods. 
3. (a) What is an Interface ? What is the difference in class and an Interface? What is use of declaring variables in an interface in Java? 
(b) State the difference in compile-time and runtime polymorphism. Show how this is implemented in Java for overriding of methods. 
4. (a) What is a Constructor ? Show with example the use and overloading of default, parameterized and copy constructor.
(b) What is use of a package in Java? How CLASSPATH helps to store and retrieve the classes? How is access protection provided for packages? 
5. (a) What do you mean by the reliability of software ? What are the qualities of programming expected for reliability? 
(b) What is the purpose of checking type compatibility? Explain various types of compatibility checks. 
6. (a) What do you mean by Semantics ? Explain the axiomatic semantics with example. 
(b) Explain by example the use of the following data aggregates to construct compound data types : 
(2) Finite Mapping.
7. (a) What is the advantage of modularity in software design ? How Encapsulation and packaging helps to provide modularity for large programs? 
(b) What are objects and classes in Java? State three major OO programming principles used in Java. 
8. (a) State and explain four main programming paradigms. Which of these paradigms is used in Ada for programming? 
(b) Write a program in Java which reads a matrix of size 3 by 3 and performs the addition of elements in each row and each column. The program prints the each row and column additions.