I think the simple private constructor will do, but not verified. I can't figure out why.
package com.codegym.task.task23.task2303;
/*
Prevent the creation of instances of a class
*/
public class Solution {
public static class Listener {
public void onMouseDown(int x, int y) {
// Do something when the mouse down event occurs
}
public void onMouseUp(int x, int y) {
// Do something when the mouse up event occurs
}
private Listener() {
}
}
public static void main(String[] args) {
}
}