Você está na página 1de 2

Code No: NR410212 NR

IV B.Tech I Semester Supplementary Examinations, February 2007


OBJECT ORIENTED PROGRAMMING & JAVA
(Electrical & Electronic Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. (a) What are the chief weakness of procedural languages ? How are they covered
in object oriented programming languages ?
(b) What are the most important common features of procedural languages and
object oriented programming languages ? [8+8]

2. Write a brief notes on the following :

(a) Data hiding


(b) Classes and objects
(c) Encapsulation
(d) Polymorphism [4×4]

3. (a) Describe the mechanism of accessing data members and member functions in
the following cases.
i. Inside the main program
ii. Inside a member function of the same class
iii. Inside a member function of another class
(b) When do you declare a member function of a class static? [12+4]

4. (a) How can a base class protect derived classes so that changes to the base class
will not affect them? Explain?
(b) When should a data member be protected: rather than private: ?
(c) Why is private: the default access level for a class? [5+6+5]

5. (a) What is an Exception? How is an Exception handled in C++?


(b) what are advantages of using Exception handling mechanism in a program?
[10+6]

6. (a) write a program that will read the value of x and evaluate the function
z = 2 for x>0
z = 0 for x=0
z = -2 for x<0
using
i. nested if statements
ii. else if statements

1 of 2
Code No: NR410212 NR
iii. conditional operator
(b) In what ways does a switch statement differ from an if statement. Give ex-
amples. [8+8]

7. (a) Write a java program to generate Pascal’s triangle.


(b) Explain usage of Command line arguments with an example. [8+8]

8. (a) What is the access rights of methods implementing an interface ?


(b) Can an interface inherit another interface ? If yes ,explain how with an exam-
ple ?
(c) Write a Java program to implement multiple inheritance using interface.
[3+5+6]

?????

2 of 2

Você também pode gostar