英文:
Android RecyclerView Java
问题
我试图理解这个概念已经有一段时间了。有人可以帮助我吗?RecyclerView.ViewHolder和RecyclerView.Adapter .ViewHolder和.Adapter。这是Java中的内部类概念还是其他什么东西。我在尝试连接这些概念。
英文:
I am trying to understand this concept for a while now. Can someone please help me? RecyclerView.ViewHolder and RecyclerView.Adapter The .ViewHolder and .Adapter. Is it a inner class concept from Java or something else. I am trying to connect dots here.
答案1
得分: 0
它们是静态的嵌套类。
您可以使用以下方式引用它们:
OuterClass.StaticNestedClass nestedObject =
new OuterClass.StaticNestedClass();
内部类不是静态的,与其封闭类的实例相关联:
OuterClass outerObject = new OuterClass()
OuterClass.InnerClass innerObject = outerObject.new InnerClass();
英文:
They are static nested classes.
You can reference them using:
OuterClass.StaticNestedClass nestedObject =
new OuterClass.StaticNestedClass();
The inner classes are not static and are associated with an instance of its enclosing class:
OuterClass outerObject = new OuterClass()
OuterClass.InnerClass innerObject = outerObject.new InnerClass();
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论