-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSolution.java
More file actions
57 lines (42 loc) · 1.41 KB
/
Copy pathSolution.java
File metadata and controls
57 lines (42 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
48
49
50
51
52
53
54
55
56
57
//So then the other disciple who came first to the tomb also entered in, and he saw and believed. (John 20:8)
package com.javarush.task.task23.task2301;
/*
Запрети наследование
*/
public class Solution {
public static final class Listener {
public void onMouseDown(int x, int y) {
//do something on mouse down event
}
public void onMouseUp(int x, int y) {
//do something on mouse up event
}
}
public static void main(String[] args) {
}
}
/*
Запрети наследование
Запрети наследование от класса Listener.
Требования:
1. Класс Listener должен быть создан внутри класса Solution.
2. Класс Listener должен быть публичным.
3. Класс Listener должен быть статическим.
4. Должна быть запрещена возможность стать потомком класса Listener.
package com.javarush.task.task23.task2301;
*
Запрети наследование
*
public class Solution {
public static class Listener {
public void onMouseDown(int x, int y) {
//do something on mouse down event
}
public void onMouseUp(int x, int y) {
//do something on mouse up event
}
}
public static void main(String[] args) {
}
}
*/