-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabstractclass.java
More file actions
27 lines (22 loc) · 834 Bytes
/
abstractclass.java
File metadata and controls
27 lines (22 loc) · 834 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
public class abstractclass {
// A class which Contains the abstract keyword in its declaration is called
// abstract class
// We cannot create the object of abstract class Also we can make the reference
// variables
// It may or may not contain abstract methods...
// It can have abstract and non abstract methods...
// tool use an abstract class you have to inherit it from subclasses...
// If a class content partial implementation then we should declare a class as
// abstract...
// if any class have an abstract method then we have to convert this class to
// abstract class it is compulsory...
}
abstract class animal {// super class...
}
class dog extends animal {// sub class...
}
class domo {
public static void main(String[] args) {
animal obj = new dog();
}
}