How can I create a new class instance from a class within a (static) class?

前端 未结 4 938
鱼传尺愫
鱼传尺愫 2021-02-03 12:54

I\'m new to Java (have experience with C#),

this is what I want to do:

public final class MyClass
{
    public class MyRelatedClass
    {
      ...
    }         


        
4条回答
  •  囚心锁ツ
    2021-02-03 13:53

    Try defining MyRelatedClass as static.

    edit
    More on the subject
    http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html

提交回复
热议问题