是java中new关键字后面的class的构造函数吗?

Is it the constructor of a class that follows the new keyword in java?

当我们写类似

的东西时
Scanner scanner = new Scanner(System.in);

我们真的用 new Scanner(System.in) 调用 Scanner class 中定义的构造函数吗? 如果答案是肯定的,那么如何在不创建实例的情况下访问构造函数,这是一种特殊类型的方法。 如果答案是否定的,那么为什么它总是必须有构造函数的名称?

Do we actually call the constructor defined in Scanner class with new Scanner(System.in)?

是的。

If the answer is yes then how is it possible to access the constructor which is a special type of method without creating an instance.

您可以复制字节码并使用相同的代码创建一个方法来做同样的事情。 但是,您不能通过正常方式将构造函数作为方法调用。

构造函数在某些方面类似于方法,但在某种意义上有所不同,它仅用于初始化新对象而不是直接调用。