Year 3Semester 5Data Structure

Data Structure

200 questions available

Lecture:
Type:
Q1
Descriptive

What is a Data Structure?

A
A data structure is a specialized format for organizing, processing, retrieving, and storing data. Common examples include arrays, linked lists, stacks, queues, trees, and graphs.
Q2
Descriptive

What is the difference between an Array and a Linked List?

A
Arrays store elements in contiguous memory locations with fixed size and O(1) random access. Linked Lists store elements with pointers to next elements, offering dynamic size and O(n) access but O(1) insertion/deletion.
Q3
Descriptive

What is an Object in Java OOP?

A
Any entity that has state and behavior is known as an object. For example, a cat is an object with states (color, age) and behaviors (eating, running).
Q4
Descriptive

What is a Class in Java?

A
A class is a blueprint from which you can create an individual object. It is a logical entity that can't be physical. A class in Java can contain Fields, Methods, and Constructors.
Q5
Descriptive

What is Inheritance in Java?

A
When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. It provides code reusability.
Q6
Descriptive

What is Polymorphism in Java?

A
If one task is performed in different ways, it is known as polymorphism. It is the ability of a message to be displayed in more than one form.
Q7
Descriptive

What is Abstraction in Java?

A
Hiding internal details and showing functionality is known as abstraction. It is achieved using abstract classes and interfaces.
Q8
Descriptive

What is Encapsulation in Java?

A
Binding code and data together into a single unit is known as encapsulation. It is achieved by making class variables private and providing public getter and setter methods.
Q9
True/False

Multiple inheritance is supported in Java through classes.

A
Q10
True/False

A class in Java is a physical entity.

A
Page 1 of 20