-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathISADemo.java
More file actions
141 lines (119 loc) · 2.02 KB
/
ISADemo.java
File metadata and controls
141 lines (119 loc) · 2.02 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Use of final
// 1. final with class , so class can't be inherit
// 2. final with method
// 3. define constant
class W
{
final int PF ;
int salary;
final int MAX_AGE =100;
/*W(){
//MAX_AGE=100;
}*/
W(int salary){
this.salary = salary;
PF = this.salary;
System.out.println("PF is "+PF+" Salary is "+this.salary);
//MAX_AGE=x;
}
private void output(){
System.out.println("w Output");
}
void show(){
System.out.println("W Show");
}
final void print(int age){
//MAX_AGE=200;
if(age==MAX_AGE){
System.out.println("Century.....");
}
System.out.println("W Print");
}
}
/*class W1 extends W
{
//@Override
void print(){
}
@Override
void show(){
System.out.println("W1 Show");
}
}*/
/*class Amit extends String{
}*/
/*final class A
{
}
class B extends A
{
}*/
abstract class Account // extends Object
{
private int x;
double balance;
void deposit(){
System.out.println("Account Class Deposit Call...");
}
void withDraw(){
System.out.println("Account Class withDraw Call...");
}
final void print(){
}
abstract void roi();
/*void roi(){
System.out.println("Account Class ROI");
}*/
}
/*class K1
{
class K2{
class K11 {
}
class K3 extends K11{
void print(){
class YY{
void output(){
}
}
}
}
}
}*/
/*class P1
{
private int p;
static int k;
static class P2{
}
}*/
class SavingAccount extends Account{
void roi(){
System.out.println("4% Interest Rec....");
}
}
class CurrentSaving extends Account{
void roi(){
System.out.println("3% Interest Pay...");
}
}
public class ISADemo {
public static void main(String[] args) {
W obj = new W(9999);
obj.salary = obj.salary*2;
System.out.println(obj.salary);
//obj.PF = obj.salary;
/*W1 obj = new W1();
obj.print();
obj.show();*/
//obj.output();
/*SavingAccount sa = new SavingAccount();
//Account ac =new Account();
sa.deposit();
sa.withDraw();*/
/*CurrentSaving cs = new CurrentSaving();
cs.deposit();
cs.withDraw();
cs.interestPay();*/
}
}