0

Really don't know what it's called so I'm having a hard time searching for the answer. Anyhow, I want to make a metode with metode inside (if that's even possible?).

public void log() {
    public makeLogElement() {
       //making a logelement to write inn
    }

    public write(String text) {
       logelement.setText(logelement.getText() + text);
    }
}
log myLog = new log();
myLog.makeLogElement();
myLog.write("This'll be written in the log");

What is the right syntax for making something like this?

1 Answers1

0

It's not possible. But you can create a class inside a method.

khusrav
  • 5,267
  • 5
  • 27
  • 38