0% found this document useful (0 votes)
16 views

CS2003 Object Oriented Programming_2022_23

Uploaded by

jagadish22112004
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)
16 views

CS2003 Object Oriented Programming_2022_23

Uploaded by

jagadish22112004
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/ 3

Shiv Nadar University Chennai

End Semester Examinations, 2022-2023 Odd


Question Paper
Name of the Programme: Common to B.Tech. AI & DS and B.Tech. CSE (IoT) Semester: III
Course Code & Name: CS2003 OBJECT ORIENTED PROGRAMMING
Regulation 2021
Time: 3 Hours Answer All Questions Maximum: 100 Marks

Q.No Questions Marks CO# KL#

1 Complete the code segment to find the perimeter and area of a circle 2 CO_1 KL_2
given a value of radius.
You should use Math.PI constant in your program. If radius is zero or
less than zero then print " please enter non zero positive number ".
2 a // Import the required package(s) and/or class(es) 1 CO_1 KL_1

public class Main{


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String courseName = scanner.nextLine();
out.println("Course: " + courseName);
}
}
b interface First{ 1 CO_2 KL_3

// default method
default void show(){
System.out.println("Default method implementation of First
interface.");
}
}

interface Second{
// Default method
default void show(){
System.out.println("Default method implementation of Second
interface.");
}
}

// Implementation class code


class Question implements First, Second{

Page 1 of 3
// Overriding default show method
public void show(){

public static void main(String args[]){


Question q = new Question();
q.show();
}
}
3 Distinguish between method overriding and overloading. 2 CO_2 KL_1

4 What are checked and unchecked exceptions in java? 2 CO_3 KL_1

5 What are the different states of a thread? 2 CO_4 KL_1

6 Distinguish between wait and sleep. 2 CO_4 KL_1

7 Compare multithreading with multi-tasking. 2 CO_4 KL_2

8 What is meant by generic classes? Give an example. 2 CO_4 KL_1

9 List the AWT controls. 2 CO_5 KL_1

10 List the differences between Swing and AWT. 2 CO_5 KL_1

11 What is Polymorphism in Java? Explain its types with an example 10 CO_2 KL_1
program.
12 a Create an abstract class 'Parent' with a method 'message'. It has two 5 CO_2 KL_6
subclasses each having a method with the same name 'message' that
prints "This is first subclass" and "This is second subclass", respectively.
Call the methods 'message' by creating an object for each subclass.
b Step 1: Create a package named 'bankAccount' and make a class 5 CO_2 KL_6
'Account'.
Step 2: Declare private data members (long acc_no, name,email,
amount) to hide the data
Step 3: Apply public getter and setter method for each private variable
in the class.
Step 4: Create the instance of Account class
Step 5: Set the values through setter methods
Step 6: Get the values through getter methods
Step 7: Print the output.
13 Discuss Exception handling in detail (definition, five keyword, types of 10 CO_3 KL_1
exception with a sample program).

Page 2 of 3
14 a Develop a multithreaded program as in the previous exercise by creating 5 CO_4 KL_4
the MyThread subclass of Thread. Then create threads as objects of the
class MyClass, which is not a subclass of Thread. MyClass will
implement the runnable interface and objects of MyClass will be
executed as threads by passing them as arguments to the Thread
constructor.
b Develop a multithreaded program by creating a subclass of Thread and 5 CO_4 KL_4
then creating, initializing, and staring two Thread objects from your
class. The threads will execute concurrently and display Java is hot,
aromatic, and invigorating to the console window.
15 Write an event handling program to handle a Button event in Swing. 10 CO_5 KL_3

16 Write an event handling program to handle a Mouse event in Applet. 15 CO_5 KL_3

17 Write a Radio Button program in Swing. 15 CO_5 KL_3

KL – Bloom’s Taxonomy Levels


(KL1: Remembering, KL2: Understanding, KL3: Applying, KL4: Analyzing, KL5: Evaluating, KL6: Creating)
CO – Course Outcomes
--------------

Page 3 of 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy