0% found this document useful (0 votes)
3 views9 pages

Object Oriented Programming CA2 QB For 2024-25

The document outlines the internal examination for the Object Oriented Programming course at the Academy of Technology for the academic session 2024-25. It includes course outcomes based on Bloom's Taxonomy and a series of questions related to key concepts such as inheritance, method overloading, and abstract classes in Java. Each question is categorized by its Bloom's Taxonomy Level (BTL) and tests students' understanding of object-oriented programming principles.
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)
3 views9 pages

Object Oriented Programming CA2 QB For 2024-25

The document outlines the internal examination for the Object Oriented Programming course at the Academy of Technology for the academic session 2024-25. It includes course outcomes based on Bloom's Taxonomy and a series of questions related to key concepts such as inheritance, method overloading, and abstract classes in Java. Each question is categorized by its Bloom's Taxonomy Level (BTL) and tests students' understanding of object-oriented programming principles.
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/ 9

ACADEMY OF TECHNOLOGY

INTERNAL EXAMINATION ODD SEM


ACADEMIC SESSION 2024-25

Paper Name: Object Oriented Programming Paper Code:OE-EE501B


Discipline: EE Semester:5th
________________________________________________________________________
___________

Course Outcomes of Paper

At the end of this module the students will be able to :


CO No. Outcome Bloom’s Taxonomy Level
OE-EE-501B.01. Describe classes, objects, members of a class 1
and relationships among them needed for a
specific problem

OE-EE-501B.02. Explain the features of object-oriented principles 2


such as encapsulation, polymorphism and
composition of systems based on object identity

OE-EE-501B.03. Analyze the concepts of inheritance and its 4


application in OO design with different design
patterns.

OE-EE-501B.04. Discuss simple abstract data types and 2


design implementations using abstraction
functions to document them

OE-EE-501B.05. Apply some common object-oriented design 3


patterns and give examples of their use.

OE-EE-501B.06. Design applications with an event-driven 6


graphical user interface.
Topic Name: Inheritance, Method,overloading, use of super keyword

Q. No Question BTL

1 In object-oriented programming, what does 1


"inheritance" refer to?
a) Creating new instances of a class.
b) Copying the methods of one class to another class.
c) Allowing a new class to take on the attributes and methods of
an existing class.
d) Combining multiple classes into a single class.

2 Which keyword is used to indicate that a class inherits from 1


another class in Java?
a) extends
b) inherits
c) derives
d) extendsFrom

3 Method overloading is a feature that allows: 1


a) Overriding a method in a subclass.
b) Calling a method from another method.
c) Creating multiple methods in the same class with the same
name but different parameters.
d) Creating methods with the same name in different classes.

4 Which of the following is true about method overloading? 1


a) The return type of overloaded methods must be different.
b) Overloaded methods must have different names.
c) Overloaded methods must have the same number and types
of parameters.
d) Overloaded methods can have different access modifiers.

5 The private members of the base class are visible in derived 1


class but are not accessible directly.
a)True b) False

6 Can a subclass call the constructor of its superclass using the 1


super keyword?
a) No, constructors cannot be called using super.
b)Yes, but only if the superclass has a default constructor.
c)Yes, to call any constructor of the superclass.
d)Yes, but only if the subclass has a default constructor.
Topic Name: Inheritance, Method,overloading, use of super keyword

7 1
What will be the output of the following Java program?

classA
{
public int i;
public int j;
A()
{
i = 1;
j = 2;
}
}
classB extendsA
{
int i;
B()
{
i=3;
super();
}
}
class super_use
{
public static void main(String args[])
{
B obj = new B();
System.out.println(obj.i+""+ obj.j)
}
}

a) 1 2
b) 3 2
c) 1 3
d) Compilation Error

8 1
Which keyword is used to prevent a method from being overridden
in a subclass?
a) final
b) static
c) private
d) protected
Topic Name: Inheritance, Method,overloading, use of super keyword

9 1
Can a subclass inherit multiple classes in Java?

a) No, Java does not support multiple inheritance.

b) Yes, but only if the classes have the same methods.

c) Yes, through a mechanism called interfaces.

d) Yes, but only if the superclass is abstract.

10 In Java, which keyword is used to invoke the 1


constructor of a superclass from a subclass
constructor?
a) superclass
b) parent
c) base
d) super
Topic Name: Method overriding, Abstract class, Dynamic method dispatch, use of final keyword

Q. No Question BTL

1 If a class inheriting an abstract class does not define all of its function then 1
it will be known as?
a) Abstract
b) A simple class
c) Static class
d) None of the mentioned

2 Which of these is not a correct statement? 1


a) Every class containing abstract method must be declared abstract
b) Abstract class defines only the structure of the class not its implementation
c) Abstract class can be initiated by new operator
d) Abstract class can be inherited

3 Abstract keyword is present in ____ package? 1


a) java.lang
b) java.util
c) java.io
d) java.system

4 What will be the output of the following Java code? 1

classA
{
public int i;
private int j;
}
classB extendsA
{
void display()
{
super.j= super.i *1+1;
super.i= 2;
System.out.println(super.i+""+ super.j);
}
}
class inheritance
{
public static void main(String args[])
{
B obj = new B();
obj.i=1;
obj.j=2;
obj.display();
}
}
a)22
b)33
c) Runtime Error
d) Compilation Error

5 What is "dynamic method dispatch" in Java? 1


a)A way to call static methods from subclasses.
b) The process of determining the appropriate method to call based on
the runtime object's type.
c)A mechanism to override private methods in subclasses.
d)A way to access methods from different classes without inheritance.

6 In method overriding, which keyword is used in the subclass to 1


indicate that a method is intended to override a method in the
superclass?
a) extends
b) override
c) super
d) @Override

7 1
Can an abstract class be instantiated (an object created)?
a) Yes, but only if it has concrete methods.
b) Yes, abstract classes can always be instantiated.
c) No, abstract classes cannot be instantiated directly.
d) Yes, but only if it's marked as static.

8 Consider the following Java code: 1

class Parent{
void show(){
System.out.println("Parent");
}
}

class Child extends Parent{


void show(){
System.out.println("Child");
}
}

public class Main {


public static void main(String[] args) {
Parent p = new Child();
Child c = new Child();

p.show();
c.show();

((Parent) c).show();
}
}
What will be the output of the program?

a) Parent
Child
Parent

b) Child
Child
Parent

c) Parent
Child
Child

d) Compilation Error

9 What will be output for the folllowing code? 1

abstract class Bank {

private abstract void withdraw(); // Line 1


abstract void deposit();
public void balance(){} //Line 2
}
class office extends Bank{ // Line 3

void deposit() { // Line 4


// TODO Auto-generated method stub

}
}
a) Compilation error in Line 1(abstract method cannot be private)
b) Compilation error in Line 2(abstract class cannot have concrete
method)
c) Compilation error in Line 3(abstract class cannot be extended)
d) Compilation error in Line 4(deposit method should have public access
modifier)

10 1

What will be output for the folllowing code?

abstract class Bank


{

private String bankName;

Bank(String bankName)
{
this.bankName = bankName;
}

public String getBankName()


{
return bankName;
}
}

class office extends Bank {

office() {
super("Axis Bank");
}

public static void main(String[] args) {


Bank bank = new office();
System.out.println(bank.getBankName());
}

}
A. Compilation error will occur because ""abstract class cannot have
constructor""
B. Compilation error will occur because ""abstract class must have an
abstract method""
C. Compilation error will occur while invoking the super class constructor
D. Code will be compiled successfully

You might also like