Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pcz_xyz
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
pcz_xyz
Commits
29aa04cd
Commit
29aa04cd
authored
Oct 25, 2022
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
podklasa do kalkulatora
parent
7bbae22b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
KalkulatorWielometodowy.java
src/main/java/kalkulatory/KalkulatorWielometodowy.java
+2
-0
KalkulatorWielometodowyBepieczny.java
...in/java/kalkulatory/KalkulatorWielometodowyBepieczny.java
+21
-0
KalkulatorWielometodowyImpl.java
src/main/java/kalkulatory/KalkulatorWielometodowyImpl.java
+5
-0
No files found.
src/main/java/kalkulatory/KalkulatorWielometodowy.java
View file @
29aa04cd
...
@@ -8,4 +8,6 @@ public interface KalkulatorWielometodowy {
...
@@ -8,4 +8,6 @@ public interface KalkulatorWielometodowy {
int
mul
(
int
x
,
int
y
);
int
mul
(
int
x
,
int
y
);
int
div
(
int
x
,
int
y
);
int
div
(
int
x
,
int
y
);
int
mod
(
int
x
,
int
y
);
}
}
src/main/java/kalkulatory/KalkulatorWielometodowyBepieczny.java
0 → 100644
View file @
29aa04cd
package
kalkulatory
;
public
class
KalkulatorWielometodowyBepieczny
extends
KalkulatorWielometodowyImpl
{
private
static
final
int
TYSIAC
=
1000
;
@Override
public
int
add
(
int
x
,
int
y
)
{
return
Math
.
addExact
(
x
,
y
);
}
@Override
public
int
sub
(
int
x
,
int
y
)
{
return
Math
.
subtractExact
(
x
,
y
);
}
@Override
public
int
mul
(
int
x
,
int
y
)
{
return
Math
.
multiplyExact
(
x
,
y
);
}
}
src/main/java/kalkulatory/KalkulatorWielometodowyImpl.java
View file @
29aa04cd
...
@@ -21,4 +21,9 @@ public class KalkulatorWielometodowyImpl implements KalkulatorWielometodowy {
...
@@ -21,4 +21,9 @@ public class KalkulatorWielometodowyImpl implements KalkulatorWielometodowy {
public
int
div
(
int
x
,
int
y
)
{
public
int
div
(
int
x
,
int
y
)
{
return
x
/
y
;
return
x
/
y
;
}
}
@Override
public
int
mod
(
int
x
,
int
y
)
{
return
x
%
y
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment