blob: 09bcf1d2ccfdaa9fa9cc2e5a3a9df57e973e031b (
plain)
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
|
class IsPositive{
public static void main(String[] a){
System.out.println(new Positive().isPositive(10));
}
}
class Positive {
public boolean isPositive(int num){
boolean positive ;
if (0 < num)
positive = true ;
else
positive = false ;
return positive ;
}
}
class Positive2 extends Positive {
public boolean isPositive(int num){
boolean positive ;
if (0 < num)
positive = true ;
else
positive = false ;
return positive ;
}
}
|