forked from deepdalsania/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractDemo.java
More file actions
52 lines (41 loc) · 723 Bytes
/
AbstractDemo.java
File metadata and controls
52 lines (41 loc) · 723 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
51
52
package oops;
import java.util.Scanner;
public class AbstractDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Demo1 d = new Demo1();
d.disp();
d.get();
d.show();
}
}
abstract class Check
{
abstract void get();
abstract void show();
void disp()
{
System.out.println("Check Class");
}
}
class Demo1 extends Check
{
int a , b;
Scanner s = new Scanner(System.in);
void get() {
System.out.println("Enter the value of A and B = ");
a = s.nextInt();
b = s.nextInt();
}
void show()
{
if(a > b){
System.out.println("Subtraction is = "+(a-b));
}else {
System.out.println("Subtraction isnot possible");
}
}
}