What is a peer class in Java?

I came across what StringBufferis called a peer class String. What is a peer class?

+5
source share
2 answers

First of all: you have to be careful with the term “peer class”, because in Java it has a clear meaning: peer classes are “interfaces” to native classes. (e.g. C ++ class) (see other anchors for details)

In your case, the term does not look for use in this particular context!

The one who called the StringBufferpeer class Stringexplicitly used this word in a general sense. In some way StringBufferthey Stringare connected, and both of them can be used for similar purposes. I suggest that in some cases they can be considered peers in the broader sense of the word.

+13
source

As I know, peer classes are written to connect code with native code. See this article, http://javapapers.com/core-java/java-peer-class/ .

+4
source

All Articles