explain oops concepts with examples?
Answer Posted / sunil
oops....its a object oriented concept....
this concept is used in different language for reducing line
of code,complexity..
oops having 4 important pillar.
1)Abstraction:
*Hide unnecessary data and show only important think.
*we can create method of abstract class if method is
Abstract method.
2)Encapsulation:
* Binding data and provide security.
ex..
create
class A
{
}
class A binding all methods,variable etc..
and provide security.
3)Polymorphism
same think but behave differently..
Same method name but different parameter...
ex..Method A(int a,int b)//A method name and 2 parameter.
{
}
Method A(int a,int b,int c)//A method name and 3 parameter.
{
}
4)Inheritance
Ability to create new class from existing class...
*inheritance variable,method from existing class
ex..
class A
{
int a,b,c;
}
class B:A
{
}
so we dont need to declare these variable again class B bcoz
these variable inherit from existing class .
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
How do you remove all elements from an arraylist in java?
What is run time allocation?
What does serializing data mean?
Define iterator and methods in iterator?
What is procedure writing?
What is double word?
Are functions objects in java?
How to make a class or a bean serializable?
What are parsing rules?
What is meant by null and void?
what is an objects lock and which objects have locks? : Java thread
Which is faster set or list in java?
What are the Static and Dynamic Variables? Differentiate them.
Does java support Operator Overloading?
Which is easier .net or java?