Skip to content

Commit 8d3ae1f

Browse files
committed
refactor: extract method isEven from method m1
1 parent cca9cd4 commit 8d3ae1f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/p2/A.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
package p2;
22

33
public class A {
4+
public boolean isEven(int v) {
5+
return v % 2 == 0;
6+
}
7+
48
public void m1(int v) {
5-
if (v % 2 == 0) {
9+
if (this.isEven(v)) {
610
System.out.println("even");
711
} else {
812
System.out.println("odd");

0 commit comments

Comments
 (0)