-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractClass.java
More file actions
32 lines (31 loc) · 887 Bytes
/
AbstractClass.java
File metadata and controls
32 lines (31 loc) · 887 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
28
29
30
31
32
// Abstract is just the generalised version of the class by using which many subClass may be created.
abstract class Test{
void greet(){
System.out.println("Hello World...");
}
abstract void abs();
abstract void sps();
}
class New extends Test{
void abs(){
System.out.println("Hello I am the abstruct inherited methode");
}
void sps(){
System.out.println("Hiii...");
}
// We new to define all the methods for the creating a concreate class
}
abstract class New1 extends Test{
void abs(){
System.out.println("Hello I am the abstruct inherited methode");
}
}
public class AbstractClass {
public static void main(String[] args) {
// Test ob = new Test(); // We cannot make an object of the abstract class
New obj = new New();
obj.greet();
obj.abs();
obj.sps();
}
}