关于 JavaFX 类的新手 Q。Main 是 JavaFX 中的一个主要的起始类,它没有构造函数(我不知道为什么)
主.java
class Main extends Application {
Log log; // class, not shown here
Work work;
@Override
public void start() // entry point
{
log = new Log("main.log"); // opens log file, need to be non-static
work = new Work();
}
}
工作.java
class Work{
public Work() // constructor
{
Main.log.write("Making work object"); // error
// What is the right method to call one non-static class from another ???
}