-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractFunction_Prog1.java
More file actions
27 lines (27 loc) · 938 Bytes
/
AbstractFunction_Prog1.java
File metadata and controls
27 lines (27 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
NOTE:
1)abstract: just a imaginary thing which does not have a concrete or physical base
2)abstract method: a method which must be used override in subclass. Define with abstract keyword
3)abstract class: class having abstract method is directly abstract class
and must be define with abstract keyword
abstract class not only have abstract method but also non abstract method.
4)either the subclass of abstract class is abstract or it must oveerride all the abstract methods
*/abstract class vishu {
abstract void ok();
void disco(){
System.out.println("disco");
}
}
class namu extends vishu{
void ok()
{
System.out.println("hello there");
}
}
public class AbstractFunction_Prog1 extends namu {
public static void main(String[] args) {
namu obj=new namu();
obj.ok();
obj.disco();
}
}