Principles of Programming Languages-Engineering-Pune University-May2018
S.E. (COMPUTER ENGG.) (II-Sem.) 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) What is an Applet ? Write a generic Skeleton of Java Applet and explain the use of each block. 
(b) State with example the use of the following built in exceptions in Java :
(1) IndexOutOfBoundsException( )
(2) NullPointerException( )
(3) ArrayIndexOutOfBoundsException( )
2. (a) What is the use of CharacterArrayReader() and CharacterArrayWriter() methods in Java ? Write a program
which reads a string of 10 characters from the user. Program extracts and prints the substring from the given string using above methods. 
(b) What is a difference in character and byte streams in Java? Give any two input and any two output classes for character streams. 
3. (a) What is inheritance ? What are the advantages of using inheritance? Show by example the simple inheritance in Java. 
(b) Explain the following Java concepts and state the difference with examples : 
(1) Interface and Abstract class
(2) Static and Dynamic Dispatch.
4. (a) What is use of Constructors ? What are types of constructors in Java? Give an example of each type. 
(b) Explain the concepts and state the difference in the following with examples : 
(1) Method Overloading and Overriding
(2) Applet and Console Program.
5. (a) What are the steps of the software development process SDLC (Waterfall Model) ? Why the use of this model is necessary in software development? 
(b) Explain how data is handled in programming languages. Give the type structure of ADA Language. 
6. (a) What do you mean by Syntax ? State and draw the EBNF definition for Syntax Rules. 
(b) Explain with example the use of the following data aggregates to construct compound data types : 
(2) Cartesian Product.
7. (a) What is generic programming ? How C++ offer generic programming constructs? Give example. 
(b) Explain why Java is Secured, Portable, and Dynamic? Which of the concepts in Java ensures these? 
8. (a) What is the advantage of grouping Units ? Explain the constructs in C++ based on the grouping of Units. 
(b) Write a program in Java using a switch-case statement to perform addition, subtraction, Multiplication and Division of given two numbers and print the result. Does the program generate any