You are on page 1of 6

SUBJECT: CS2311 OBJECT ORIENTED PROGRAMMING

UNIT-I

PART A

1.Write the difference between oop and pop

2.What are the benefits of oop?

3.What are the various applications of oop?

4.What is a Datatype?

5.Define typecast operator

6.What do u meant by inline functions?

7.Write a simple c++ pgm to swap two nos without using temp variables

8.What is the difference between return by reference and call by reference?

9.What is function prototyping?

10.What do you meant by reference variable?

PART-B

1.Illustrate the function overloading concept with a C++ program to find the
volume of cube and cylinder

2.Explain the basic concepts of oops with suitable Examples

3.Write a C++ program to construct student mark list for three subjects.

Write the pgm to display name,rollno,marks,avg and total.Use clss and


objects.

4.Explain the control structures in C++

5.Define Call by reference and Return by reference.

UNIT-2

PART-A
1.What is general form of class declaration?

2.What are the two ways of defining a method?

3.Define static data members and static member functions.

4.What is a Friend function?

5.What is constructor and destructor?What are the types of constructor?

6.Why there is a need to have private member functions?

7.Define about arrays within a class

8.What is the need of scope resolution operator?

PART-B

1.Explain the Friend function concept with an example program.

2.What is Dynamic Initialisation of objects?Give a program to illustrate your


answer.

3.Explain the constructor concept with its types with example programs.

4.Explain the concept of objects as functional arguments.

5.Write a C++ program to manage a bank account using classes and


objects.

UNIT-3

PART-A

1.What is operator overloading?

2.State the rules of operator overloading.

3.Define Inheritance and its types

4.What is this pointer?

5.Define abstract class

6.Explain the different visibility or access modifiers?


7.Define polymorphism.

8.What is Virtual function?

9.What are the operators that cannot be overloaded?


10.What is the difference between virtual functions and virtual classes?

PART-B

1.Explain virtual function concept with a program to find the distance


between two objects.

2.Explain the Inheritance types with example programs for last three types.

3.What do u meant by operator overloading?what are its types?Explain the


types with eg programs.

4.Expalin single and multiple Inheritance with an example of your own.

5.Describe manipulation of strings with overloading the following


operators:<<,>>,+,-

UNIT-4

PART-A

1.How java differs from C++?

2.What are command Line arguments?

3.Define Java virtual machine concept.

4.What are the different Java tokens and statements?

5.What is a Final Class?

6.Illustrate the syntax of array in Java.

7.Write a simple Java program

8.What are the input and output statements in Java?

9.Expalin vectors in java

10.What is method overriding


PART-B

1.Explain Method overriding in Java with an eg.

2.Construct the pictorial representation of Java Virtual Machine.

3.Write a program in java using constructor concept.

4.What are the different statements and its use in java?

5.Illustrate Inheritance in Java with suitable program.

6.Give a explanatory answer to define the difference between Java and C+


+,Characteristics of Java and the concepts in java

UNIT-5

PART-A

1. What is an Interface and how will you extend it?

• An interface is basically a kind of class. Like classes interfaces contains


methods and variables but with a major difference.
• The difference is that interface defines only abstract methods and final
fields. This means that interface do not specify any code to implement
these methods and data fields contain only constants therefore it is the
responsibility of the class that implements an interface to define the
code for implementation of these methods
• Like classes interfaces can also be extended. The new sub interface
will inherit all the members of the super interface in the manner similar
to sub classes
• This is achieved by using the keyword extends.

2. Define package concept

• Packages in java is a concept similar to class libraries in other


languages
• They are Java’s way of grouping a variety of classes and/or interfaces
together. The grouping is usually done according to functionality.
• Packages act as containers for classes.

3. What are the different errors?

Errors can be mainly classified into two categories.


• Compile time error. – All syntax errors will be displayed in the compiler.
• Run time error – Errors due to wrong logic or stack overflow.

4.What is the difference between error and exception?

• An error may produce an incorrect output or may terminate the


execution of the program abruptly. Errors are the wrongs that can
make a program go wrong.
• An exception is a condition that is caused by a run time error in the
program. All exceptions are caught and handled by the java compiler.

5. What is a thread? What are the different states in its life cycle?

In Java the Thread class represents a single independent path of execution in a Java
Virtual Machine.

The different states in a thread’s lifecycle are:

1. New born state


2. Runnable state
3. Running state
4. Blocked state
5. Dead state

6. What is Multithreading?

The ability of an operating system to execute different parts of a program, called


threads, simultaneously. The programmer must carefully design the program in
such a way that all the threads can run at the same time without interfering with
each other.

7. Define Applet

An applet is a special kind of Java program that a browser enabled with Java
technology can download from the internet and run. An applet is typically
embedded inside a web page and runs in the context of a browser. An applet must
be a subclass of the java.applet.Applet.class. The Applet class provides the
standard interface between the applet and the browser environment.

8. Write an applet program to design a web page?

9. What is Thread priority?

• In java each thread is assigned a priority which affects the order in


which it is scheduled for running.
• The threads of the same priority are given equal treatment by the java
scheduler and therefore they share the processor on a first come first
serve basis.

10. What are the different types of Thread?

we have three types of threads


1.User Define Thread(main Thread always execute first and
start another thread)
2. Daemon thread (garbage Collection low priority thread)
3. GUI Thread( make as new create in main methods )

11. How will you run the applet?

12. What is the difference between application and applet program?

PART-B

1. Explain the Life cycle of Thread with an eg

2. Describe package concept to perform arithmetic operations.Explain

how to use it?

3.Explain the different states in Life cycle of applet?

4.Define Interfaces?Explain the extension of interfaces,implementation and


accessing it.

5.What are the Different Exceptions caught,Explain the types with eg


program.

6.Explain try, catch and finally statements with eg.

You might also like