Abstraction Notes
Abstraction Notes
Abstraction Notes
~~~~~~~~~~
Definition:
~~~~~~~~
Abstraction is one of the object oriented programming principle,
it is the process of retrieving the essential details or necessary
details without having background details
Ex:
ex:
~~
abstract void m1();
note:
~~~~
in java, we are making methods as an abstract methods we
are using one java keyword i.e 'abstract' before the method
declaration.
ex:
~~
void m1()
{
//logic
}
where m1() is an concrete method since it contains both
heading and body.
ex:
~~~
abstract class Test1
{
abstract void m1();
void m2()
{
}
}
note:
~~~~
If a class having atleast one abstract method the corresponding
class will become abstract class
/*
javac AbDemo2.java
*/
//assignment-1
//assignment-2