summaryrefslogtreecommitdiff
path: root/typecheck/tests/IsPositive.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-10 23:40:25 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-10 23:40:25 -0600
commit1080b37bbe40fe56b919d22804c159cccdca3c95 (patch)
tree8ddbb9528f575e537f925b266c8f366be6acc8b7 /typecheck/tests/IsPositive.java
parent61a28b7f8e709d1884ccab15f0dc38ed19dfde70 (diff)
Library rename, created A4 directories
Diffstat (limited to 'typecheck/tests/IsPositive.java')
-rw-r--r--typecheck/tests/IsPositive.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/typecheck/tests/IsPositive.java b/typecheck/tests/IsPositive.java
index 087cd3f..09bcf1d 100644
--- a/typecheck/tests/IsPositive.java
+++ b/typecheck/tests/IsPositive.java
@@ -1,12 +1,24 @@
class IsPositive{
public static void main(String[] a){
- System.out.println(new Positive().isPos(10));
+ System.out.println(new Positive().isPositive(10));
}
}
class Positive {
- public bool isPos(int num){
- bool 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 ;