Skip to content

Commit f59fbfa

Browse files
committed
Exercise 6.2
1 parent 9a564e6 commit f59fbfa

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

ch06/ValueMethods.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@ public class ValueMethods
22
{
33
public static void main(String[] args)
44
{
5-
System.out.println("Boolean test");
6-
System.out.println(isDivisible(4,2));
7-
System.out.println(isDivisible(5,2));
5+
System.out.println(isDivisible(4, 2));
6+
System.out.println(isDivisible(5, 2));
87

98
}
109

1110
//Exercise 6.2
1211
private static boolean isDivisible(int n, int m)
1312
{
14-
if (n % m == 0)
15-
{
16-
return true;
17-
} else
18-
{
19-
return false;
20-
}
13+
return (n % m == 0);
2114
}
2215
}

0 commit comments

Comments
 (0)