0% found this document useful (0 votes)
51 views1 page

Subject: Csf213 Object-Oriented Programming

The document is an exam for the subject Object-Oriented Programming. It contains 15 multiple choice and written response questions covering topics like: 1. Benefits of OOP over procedural programming 2. Regular expressions and password validation 3. Differences between ArrayList and LinkedLists 4. Serialization in Java 5. Differences between Comparator and Comparable interfaces 6. Advantages of Swing over AWT 7. Implementing Runnable vs extending Thread 8. Using HashMaps and Iterators 9. Writing Python programs to count and sort words The questions are worth a total of 60 marks and test knowledge of core OOP concepts in Java as well as basic Python programming.

Uploaded by

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

Subject: Csf213 Object-Oriented Programming

The document is an exam for the subject Object-Oriented Programming. It contains 15 multiple choice and written response questions covering topics like: 1. Benefits of OOP over procedural programming 2. Regular expressions and password validation 3. Differences between ArrayList and LinkedLists 4. Serialization in Java 5. Differences between Comparator and Comparable interfaces 6. Advantages of Swing over AWT 7. Implementing Runnable vs extending Thread 8. Using HashMaps and Iterators 9. Writing Python programs to count and sort words The questions are worth a total of 60 marks and test knowledge of core OOP concepts in Java as well as basic Python programming.

Uploaded by

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

Set - I

BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI-HYDERABAD CAMPUS


SECOND SEMESTER 2019-20
Subject: CSF213 OBJECT-ORIENTED PROGRAMMING
Date: 28.11.2020 Time: 2 hours Max. Marks: 60
Part-A (10 × 2 = 20 Marks)

Q. No Question Marks

1. Compare the benefits of object oriented programming over procedure programming. [2]
2. Develop a function that returns the last digit of an entered number. [2]
3. What is the cause of NoClassFoundError and NoSuchMethodError? Show with an example. [2]
4. A programmer has written the following line of code in a predicate method (i.e., a method that [2]
returns a boolean):
public boolean IsNameQ () {
String name = readLine ("Enter name: ");
return (name == "Q");}
The programmer of this code thinks that the program will return true if the player’s name is
"Q".
Do you think the programmer is correct? Justify your answer.
5. Build a regular expression to validate a password field that takes 6 characters including one [2]
upper case and a special character.
6. What is the importance of serialization in java? [2]
7. How do you think ArrayList are different from Linked List? [2]
8. Identify the differences between the Comparator and Comparable interfaces? [2]
9. List two main advantages of Swing class over AWT classes. [2]
10. Recommend a way to set the layout manager to BorderLayout, while creating a JFrame [2]
named myFrame.
Part-B (5 × 8 = 40 Marks)

Q. No Question Marks
11a) Write a program to display a given large number in Indian number system format using 6
commas in proper places. For example, if the input is 1000000, the program should output
10,00,000.
b) Find and fix the error(s) in the given code: 2
1. public class Helloworld
2. public static void main (String args) {
3. System.out.println (“Welcome to Java world”);}}
12. a) Create a program to calculate the frequency of the characters in a given string. 6
b) Considering the following code: 2
public boolean IsNameQ() {
String name = readLine ("Enter name: ");
char ch = name.charAt(0);
return ((ch == 'Q’) && (name.length() == 1));}
How is the code above behaves if the input is "Q"?
13. a) We should implement Runnable interface or extend Thread class. Identify the differences 4
between implementing Runnable and extending Thread?
b) Develop a program that accepts a series of employee ID numbers, first names, and 4
last names from the keyboard and saves the data to a file. Save the program as
MyEmployeeList.java.
14. a) HashMap has overridden the method toString( ) to print the key-value pairs easily. Create a 4
program to map names to salary of an Employee using HashMap and print key-value pairs.
b) Illustrate Iterator class to remove all the odd elements in a set S of Integers. 4
15. Write a Python program to count and display the number of words in a given sentence 8
entered by the user. The program should also display the words in alphabetically sorted
order.

You might also like