-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstract.java
More file actions
50 lines (36 loc) · 899 Bytes
/
Copy pathAbstract.java
File metadata and controls
50 lines (36 loc) · 899 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
abstract class College1 {
abstract void Bca();
}
abstract class College2 extends College1 {
abstract void Mca();
}
class Student extends College2 {
String Name = "Nikhil";
String Branch = "LU";
public void Bca() {
System.out.println("Student of" + Branch + Name);
}
public void Mca() {
System.out.println(Name + " is Dreaming to do Mca");
}
}
class Student2 extends College2 {
String Name = "Amit";
String Branch = "Aktu";
public void Bca() {
System.out.println("Student of" + Branch + Name);
}
public void Mca() {
System.out.println(Name + "Is Dreamin to do Mca:");
}
}
public class Abstract {
public static void main(String[] args) {
College2 obj = new Student();
obj.Bca();
obj.Mca();
College2 ob = new Student2();
ob.Bca();
ob.Mca();
}
}