You are on page 1of 7

NAME : SUMAN DAS

STREAM : B. TECH IN COMPUTER SCIENCE & ENGINEERING


ROLL NO. : 25500121057
REGISTRATION NO. : 212550100110128 OF 2021-22
SECTION : A
SEMESTER : 5TH
YEAR : 3RD
SESSION : 2023-2024
COLLEGE NAME : DR. SUDHIR CHANDRA SUR INSTITUTE OF TECHNOLOGY
& SPORTS COMPLEX
1) Identify the Importance of Java.

Ans. : One of the most significant advantages of Java is its ability to move easily from one

computer system to another. The ability to run the same program on many different systems is

crucial to World Wide Web software, and Java succeeds at this by being platform-independent at

both the source and binary levels.


2) Why use Object Oriented Programming?

Ans. : Object-oriented programming languages make it easier to understand how a program

works by bringing together data and its behaviour (or method) in a single bundle called an

“object.” In contrast, functional programming is a model based on performing operations, or

functions, on static data.


3) Building Block of OOP.

Ans. : Every Programmer has majorly two options when he gets into the field of coding,

that is he can choose to program either with Object Oriented programming or Procedural

Programming. Both of these paradigms of programming have contrasting features, but

the one suited for the programmer depends upon the requirements of the project and the

application of the project that he is working on. Additionally, it also depends on the

comfort level of the user when it comes to using the language.


4) What is Polymorphism? How does function overloading implements
Polymorphism?

Ans. : Polymorphism is a popular concept in object-oriented programming (OOP),

referring to the idea that an entity in code such as a variable, function or object can have

more than one form. The word polymorphism is derived from Greek and means "having

multiple forms." Apart from computer programming, the idea of polymorphism occurs in

other real-world areas, including biology, chemistry and drug development.

Polymorphism is one of the most important concepts in OOP. It describes the ability of

something to have or to be displayed in more than one form. The different forms arise

because these entities can be assigned different meanings and used in various ways in

multiple contexts.
Let us consider the given example in which the function perimeter() is overloaded. In each function, the perimeter of a different
shape (square, rectangle and trapezium) is calculated.

public class Perimeter


{
public double perimeter(double s)
{
double p = 4 * s;
return p;
}

public double perimeter(double l,


double b)
{
double p = 2 * (l + b);
return p;
}

public double perimeter(double a,


double b,
double c,
double d)
{
double p = a + b + c + d;
return p;
}
}

Thus, overloading implements polymorphism.


THANK YOU!

You might also like