Answer:
Encapsulation:-It is the binding of the data and functions so that they works as one unit.
Inheritance:-When one class acquires the property of another class it is called inheritance.
Polymorphism :-It generally means more than one form
Explanation:
Encapsulation:- class is an example of encapsulation it can hold different data types and functions in a single container called class.
class Name{
public:
string first_name;
string last_name;
void Display()
{
cout<<first_name<<" "<<last_name<<endl;
}
};
Inheritance:-The property of a class acquiring the properties of another class is called inheritance.
Now we will inherit the above defined class.
class person: public Name
{
public:
char gender;
int age;
void Display()
{
cout<<first_name<<" "<<last_name<<gender<<age<<endl;
}
};
int main()
{
Name n;
person p;
n.Display();
p.Display();
}
Polymorphism- There are two types of polymorphism:-
1.Run time polymorphism=The values are decided at run time.
2.Compile time polymorphism=The values are decided at compile time.
Example:-In the above example we have function Display() in both the classes.This is an example of compile-time polymorphism. We are deciding at the time of compilation which display to use.
Answer:
Check the explanation
Explanation:
All website around the world/internet is a collection of different web pages, HTML can be referred to as the single most essential standard when it comes to web design, as well as it being the only one that’s enormously required or needed if you plan to create a web page.
to answer the question above, we will be creating an HTML document that describes nested ordered lists of cars, kindly check the attached images below to see the written codes to solve the question.
A two dimensional area with recognizable boundary is called a shape
Answer:
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args)
{
Stack<Integer> mat=new Stack<Integer>();
mat.add(1);
mat.add(3);
mat.add(6);
System.out.println(mat);
Object [] a=mat.toArray();
for(int i=0;i<a.length;i++)
System.out.println(a[i]);
}
}
Explanation:
An integer type stack st is created;
1,3 and 6 are added to the stack.
printing the contents of the stack.
array a is created form the stack using toArray().
Then printing the array.
C) Filters make it easier to find specific information in large databases.