-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMath.java
More file actions
47 lines (44 loc) · 1.41 KB
/
Math.java
File metadata and controls
47 lines (44 loc) · 1.41 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.codacy.utils;
public class Math {
private int magicNumber;
int some = 1;
public Math(int magicNumber) {
this.magicNumber = magicNumber;
}
/**
* Adds 2 numbers, unless there is a magic number on the second argument
*/
public int magicAdd(int x, int y) {
if (y == magicNumber) {
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
return y - x;
} else {
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
System.out.println("hey");
return x + y;
}
}
}