Android RecyclerView Java

huangapple go评论76阅读模式
英文:

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();

huangapple
  • 本文由 发表于 2020年8月5日 07:35:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/63256455.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定