E
E
EnderBro3D2018-06-21 13:47:27
Java
EnderBro3D, 2018-06-21 13:47:27

[Intellij IDEA] How to override a class method, having its instance?

It seems that I formulated it correctly, do not hit with slippers =)
I need to override the method in the class. There are a lot of methods, it’s difficult to do with pens (.
Here is an example of a class:

public class Example extends AbstractExample {

    private AbstractExample example;

    public Example(AbstractExample example) {
        this.example = example;
    }

    void myMethod() {
        int i = 1 + 1;
    }

    @Override
    void doSomething() {
        example.doSomething();
    }

    @Override
    void doSomethingWith(Object object) {
        example.doSomethingWith(object);
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2018-06-21
@EnderBro3D

- "ctrl + o"
- select methods
- press "ok"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question