-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSolution.java
More file actions
75 lines (53 loc) · 1.8 KB
/
Solution.java
File metadata and controls
75 lines (53 loc) · 1.8 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.javarush.task.task15.task1510;
//I am the true vine, and my Father is the husbandman. (John 15:1)
/*
Все лишнее - прочь!
*/
public class Solution {
public static void main(String[] args) {
add((short) 1, 2f);
add(1, 2);
add(2d, 2);
add((byte) 1, 2d);
}
public static void add(int i, int j) {
System.out.println("Integer addition");
}
public static void add(int i, double j) {
System.out.println("Integer and double addition");
}
public static void add(double i, double j) {
System.out.println("Double addition");
}
}
/*
Все лишнее - прочь!
Убрать в методе main лишние строки, для которых метод add не реализован.
Требования:
1. В классе Solution должно быть реализовано три метода add.
2. Метод main не должен содержать вызов метода add с параметрами "1" и 2d.
3. Все методы класса Solution должны быть статическими.
4. Все методы класса Solution должны быть публичными.
package com.javarush.task.task15.task1510;
*
Все лишнее - прочь!
*
public class Solution {
public static void main(String[] args) {
add((short) 1, 2f);
add(1, 2);
add(2d, 2);
add("1",2d);
add((byte) 1, 2d);
}
public static void add(int i, int j) {
System.out.println("Integer addition");
}
public static void add(int i, double j) {
System.out.println("Integer and double addition");
}
public static void add(double i, double j) {
System.out.println("Double addition");
}
}
*/