Você está na página 1de 2

K. L. E.

Society's
B. V. Bhoomaraddi College of Engineering & Technology, Hubli.
Department of Information Science and Engineering

Chapter No. 4 : Data structures


Sl. No. Questions
Explain the working of stack for storing a collection of following strings
Guru, Vishnu, Dev, Ravi, Vinay, Kumar.
If the size of the stack is 4 explain the following
a) stack overflow
1
b) stack underflow
c) push
d) pop
e) topofstack
Traverse the given tree using Inorder, Preorder and Postorder traversals.

3 Define the tree data structure. Explain the terms used in trees.
4 Define data structure. Explain any two data structure with example.
5 List Linear and Non Linear data structure. Explain with example Non-linear data structure.
6 With examples explain applications of a) stack b) Linked list c) Trees

Chapter No. 5 : Inheritance and Polymorphism


Sl. No. Questions
Explain the advantages of inheritance. What are the importance of super keyword in
1
inheritance with programming examples
Compare and contrast abstract classes and interfaces. Why would you use an abstract
2
class. Explain with an example.
What are interfaces and explain its characteristics of data members defined inside the
3
interfaces with example.
Draw an inheritance hierarchy for students at a university. Use Student as the
superclass of the hierarchy, then extend Student with classes Graduate and
Undergraduate. Future extend Undergraduate subcalss to Freshman, Sophomore,
4
Junior and Senior might and Doctoral and Masters might be subclasses of
Graduate. After drawing the hierarchy, discuss the relationships that exist between the
classes and implement the same using Java.
5 Write a java program for the following classes in the inheritance hierarchy
a) Animal b) Dog c) Wolf d) Coyote e) Cat f) Tiger g) Lion
Where wolves and coyotes are specializations of dogs, tigers and lions are
specializations of cats, and dogs and cats are specializations of animals. Think about the
different attributes and behaviour of each animal and move common functionality up the
K. L. E. Society's
B. V. Bhoomaraddi College of Engineering & Technology, Hubli.
Department of Information Science and Engineering

inheritance hierarchy and specialized functionality down the hierarchy.


What are the different types of inheritance supported in Java. Explain each type with
6
example class hierarchy.
Differentiate between method overloading and overriding in Java with suitable
7
programming example.
Explain the importance of dynamic method dispatch (late binding) over a static method
8
dispatch (early binding) with suitable example.
Write a java program for the following description.
- Create a class called Vehicle
- Declare the String type of variable called vehicleType in Vehicle Class.
9 - Extend the Vehicle class to Car class and declare a variable called modelType which is
String.
- Create a method called showDetails() which displays the vehicle type and car model.
- Create an object of Car class and call the showDetails()
Write a java program that demonstrates the use of Inheritance in java using following
business rules
- Create a class called Animal, Dog, Cat
10 - Assume the inheritance hierarchy among the above classes.
- Create a operations called eat(), sleep(), walk() for the animal.
- Decide and explain in what terms the above operation will be implemented. (Hint :
abstract method or interface)
Write a java program explaining is-a relationship between the classes called Programmer
and Employee. Consider EmpId, Name as private members of Employee class and Skills
11 as private member of Programmer class. Create a getter and setter methods that can be
used for setting the values for the member variables and displaying the contents of the
members.
Write a java program to create a class named Person and its two subclasses named
Student and Employee. Make Faculty and Staff subclasses of Employee. A person has a
name, address, phone number, and email address. A student has a class status
12
(freshman, sophomore, junior, or senior). An employee has an office, salary, and date-
hired. Create a overridden method called diplayDetails() that displays the details of
Students and Employees.

Chapter No. 6 : Packages, Interfaces and Exceptions


Sl. No. Questions
Define packages and with programming examples explain different types of access
1
specifiers.
2 What are the advantages of Packages. Explain how to create packages with example.
3 What is the importance of interface. How to create an interface explain it simple example.
4 List and explain the important aspects of Interface.
Create a class called PurchaseBill that implements Tax interface. Where the tax is
5 calculated for 4% of purchased bill. Create a Demo class that uses the necessary
operations.
6 What are the different types of exceptions supported by Java.

Você também pode gostar