0% found this document useful (0 votes)
11 views2 pages

Oops An

This document is an answer key for a question paper on Object Oriented Programming for B.E/B.Tech students at M.I.E.T. Engineering College. It includes definitions, comparisons, and lists related to key concepts such as encapsulation, static methods, overloading vs overriding, abstract classes, multithreading, user-defined exceptions, string methods, StringBuilder functions, KeyListener methods, and Grid Layout syntax. The document is structured in two parts, with Part A consisting of short answer questions and Part B likely containing more detailed questions.

Uploaded by

jayanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Oops An

This document is an answer key for a question paper on Object Oriented Programming for B.E/B.Tech students at M.I.E.T. Engineering College. It includes definitions, comparisons, and lists related to key concepts such as encapsulation, static methods, overloading vs overriding, abstract classes, multithreading, user-defined exceptions, string methods, StringBuilder functions, KeyListener methods, and Grid Layout syntax. The document is structured in two parts, with Part A consisting of short answer questions and Part B likely containing more detailed questions.

Uploaded by

jayanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

M.I.E.T.

ENGINEERING COLLEGE
(AUTONOMOUS)
Tiruchirappalli-620007
Question Paper Code: 106304
B.E/B.Tech DEGREE EXAMINATION.NOV/DEC 2024
COMPUTER SCIENCE AND ENGINEERING
THIRD SEMESTER
CS3391-OBJECT ORIENTED PROGRAMMING
(Common to Information Technology, Biomedical Engineering)

ANSWER KEY
PART-A (10 x 2=20 Marks)

Questions
1. Define Encapsulation.
 Binding of data and method together in a single entity. ( 2marks )
 Integrating data (variables) and code (methods) into a single unit.

2. List various static methods.


 Main()

 instance variables
3. Differentiate overloading and overriding.
For any two points(2 marks)
overloading overriding
 Performed within a class.  Occurs in two clases. (inheritance
concept).
 Compile time polymorphism.  Runtime polymorphism.

 Increase the readability of program.  Provide specific implementation of


method.
 Parameter must be different.  Parameter must be same.

4. What is abstract class?


 Declared with the abstract keyword.
 A class that cannot be instantiated by itself.
 Constructors are allowed.
5. What is multithreaded programming?
 A process in which two or more parts of the same process run simultaneously. (2marks)
 Created either by extending Thread class or Runnable interface.

6. Mention the need for user defined exception with an example. (any two point 1 mark)
 Facility to create our own exceptions.
 Throwing that exception using the ‘throw’ keyword.
 Customize the exception according to user needs.
 Eg: Divide by zero exception , Invalid age exception (1 mark)
7. List any 4 basic string methods. (Any four 2marks)
 CharAt()
 Concat()
 CompareTo()
 Equals()
 Indexof()
 Length()
 EqualsIgnoreCase()
8. What is the function of StringBuilder()? (any four 2marks)
 Append()
 Replace()
 Insert()
 Delete()
 Reverse()
 Length()
9. List the methods of KeyListener.
 Key Pressed
 Key Released
 Key typed
10. Name the syntax for creating Grid Layout. (any one 2 marks)
 Grinpane gridPane= new GridPane();
 GridLayout(int rows, int cols);
 GridLayout(int rows, int cols, int hgap, int vgap);
PART B

You might also like