- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractClassAndAbstractMethods.java
More file actions
Latest commit
34 lines (32 loc) · 804 Bytes
/
Copy pathAbstractClassAndAbstractMethods.java
File metadata and controls
34 lines (32 loc) · 804 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
33
34
abstractclassParent2{
publicParent2(){
System.out.println("Mai base2 ka constructor hoon");
}
publicvoidsayHello(){
System.out.println("Hello");
}
abstractpublicvoidgreet();
abstractpublicvoidgreet2();
}
classChild2extendsParent2{
@Override
publicvoidgreet(){
System.out.println("Good morning");
}
@Override
publicvoidgreet2(){
System.out.println("Good afternoon");
}
}
abstractclassChild3extendsParent2{
publicvoidth(){
System.out.println("I am good");
}
}
publicclassAbstractClassAndAbstractMethods {
publicstaticvoidmain(String[] args) {
//Parent2 p = new Parent2(); -- error
Child2c = newChild2();
//Child3 c3 = new Child3(); -- error
}
}