Oops An
Oops An
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.
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